Re: cwm: remove mouse resize window

2016-10-04 Thread Okan Demirmen
On Tue 2016.10.04 at 15:29 +0200, Vadim Vygonets wrote:
> Quoth Okan Demirmen on Wed, Sep 28, 2016:
> > We currently print the x/y dimensions only for mouse based actions; we
> > don't for kbd, nor do we do anything with mouse/kbd window moves (such
> > as printing the x/y coordinates, etc). So why have mouse-resize be
> > different?  Thus, the below crudely removes it.
> 
> I use it for xterms, and I'd rather have it in both mouse and
> keyboard based resizes.

Hi Vadim - Not sure if you saw my other reply, or commit, but it's
staying and was expanded a bit. As for displaying on kb requests, that's
harder to do since a KeyRelease event would make it disappear so it'll
be visible for a tiny amount of time; maybe a timer or some such or
other idea, not sure - haven't thought about it...not too important
imho yet.

Thanks,
Okan



Re: cwm: remove mouse resize window

2016-10-04 Thread Vadim Vygonets
Quoth Okan Demirmen on Wed, Sep 28, 2016:
> We currently print the x/y dimensions only for mouse based actions; we
> don't for kbd, nor do we do anything with mouse/kbd window moves (such
> as printing the x/y coordinates, etc). So why have mouse-resize be
> different?  Thus, the below crudely removes it.

I use it for xterms, and I'd rather have it in both mouse and
keyboard based resizes.

Vadik.

-- 
Weiner's Law of Libraries:
There are no answers, only cross references.



Re: cwm: remove mouse resize window

2016-09-28 Thread Okan Demirmen
On Wed 2016.09.28 at 21:33 +0100, Stuart Henderson wrote:
> On 2016/09/28 13:56, Bryan Steele wrote:
> > I typically use the mouse for window resizes, for xterms it's useful
> > even to quickly see the dimensions even without resizing, ofc there
> > are other ways to glean that info.. but if it's not too horrible, I'd
> > like if it could stay.
> 
> Exactly the same here.

Got it; thanks for the replies!

(Martin, I have another way to do the position, but thanks anyway!)



Re: cwm: remove mouse resize window

2016-09-28 Thread Stuart Henderson
On 2016/09/28 13:56, Bryan Steele wrote:
> I typically use the mouse for window resizes, for xterms it's useful
> even to quickly see the dimensions even without resizing, ofc there
> are other ways to glean that info.. but if it's not too horrible, I'd
> like if it could stay.

Exactly the same here.



Re: cwm: remove mouse resize window

2016-09-28 Thread Martin Brandenburg
On Wed, 28 Sep 2016, Okan Demirmen wrote:

> Hi,
> 
> Curious what the reaction might be if I removed the little geometry
> window in the top-left corner for mouse/pointer based window resizes.

I don't know about anyone else, but I use this for one thing only:
making sure my terminal windows are still exactly 80 columns wide after
resizing them to be longer (or going back to 80 after making one wider
temporarily). Any other window I don't care about the exact size.

I suppose I could use stty and the keyboard resizing options if this
went away, but it seems more natural to move and resize windows with the
mouse.

> 
> We currently print the x/y dimensions only for mouse based actions; we
> don't for kbd, nor do we do anything with mouse/kbd window moves (such
> as printing the x/y coordinates, etc). So why have mouse-resize be
> different?  Thus, the below crudely removes it.
> 
> One reason to remove it is for simplicity; this is the only place we
> need to hold and carry around menuwin and a drawable. If we abused
> menuwin/drawable in other locations but the actual menu'ing subsystem,
> then ok. Alternatively, can create/destroy each time for a mouse-resize,
> but likely not worth it, maybe it should stay...

So make it display on movement too? I'm not sure how useful it is, but
it adds symmetry.

Martin

Index: mousefunc.c
===
RCS file: /cvs/xenocara/app/cwm/mousefunc.c,v
retrieving revision 1.107
diff -u -p -r1.107 mousefunc.c
--- mousefunc.c 28 Sep 2016 17:06:33 -  1.107
+++ mousefunc.c 28 Sep 2016 18:33:12 -
@@ -32,16 +32,17 @@
 
 #include "calmwm.h"
 
-static voidmousefunc_sweep_draw(struct client_ctx *);
+static voidmousefunc_sweep_draw(struct client_ctx *, int move);
 
 static void
-mousefunc_sweep_draw(struct client_ctx *cc)
+mousefunc_sweep_draw(struct client_ctx *cc, int move)
 {
struct screen_ctx   *sc = cc->sc;
char s[14]; /* fits "  x  \0" */
XGlyphInfo   extents;
 
-   (void)snprintf(s, sizeof(s), " %4d x %-4d ", cc->dim.w, cc->dim.h);
+   (void)snprintf(s, sizeof(s), " %4d x %-4d ",
+   move ? cc->geom.x : cc->dim.w, move ? cc->geom.y : cc->dim.h);
 
XftTextExtentsUtf8(X_Dpy, sc->xftfont, (const FcChar8*)s,
strlen(s), );
@@ -89,7 +90,7 @@ mousefunc_client_resize(struct client_ct
cc->geom.h = ev.xmotion.y;
client_applysizehints(cc);
client_resize(cc, 1);
-   mousefunc_sweep_draw(cc);
+   mousefunc_sweep_draw(cc, 0);
break;
case ButtonRelease:
client_resize(cc, 1);
@@ -151,9 +152,12 @@ mousefunc_client_move(struct client_ctx 
cc->geom.y + cc->geom.h + (cc->bwidth * 2),
area.y, area.y + area.h, sc->snapdist);
client_move(cc);
+   mousefunc_sweep_draw(cc, 1);
break;
case ButtonRelease:
client_move(cc);
+   XUnmapWindow(X_Dpy, sc->menuwin);
+   XReparentWindow(X_Dpy, sc->menuwin, sc->rootwin, 0, 0);
xu_ptr_ungrab();
return;
}



Re: cwm: remove mouse resize window

2016-09-28 Thread Bryan Steele
On Wed, Sep 28, 2016 at 01:34:52PM -0400, Okan Demirmen wrote:
> Hi,
> 
> Curious what the reaction might be if I removed the little geometry
> window in the top-left corner for mouse/pointer based window resizes.
> 
> We currently print the x/y dimensions only for mouse based actions; we
> don't for kbd, nor do we do anything with mouse/kbd window moves (such
> as printing the x/y coordinates, etc). So why have mouse-resize be
> different?  Thus, the below crudely removes it.
> 
> One reason to remove it is for simplicity; this is the only place we
> need to hold and carry around menuwin and a drawable. If we abused
> menuwin/drawable in other locations but the actual menu'ing subsystem,
> then ok. Alternatively, can create/destroy each time for a mouse-resize,
> but likely not worth it, maybe it should stay...
> 
> Thanks,
> Okan
> 
> Index: mousefunc.c
> ===
> RCS file: /home/open/cvs/xenocara/app/cwm/mousefunc.c,v
> retrieving revision 1.107
> diff -u -p -r1.107 mousefunc.c
> --- mousefunc.c   28 Sep 2016 17:06:33 -  1.107
> +++ mousefunc.c   28 Sep 2016 17:23:45 -
> @@ -89,7 +89,6 @@ mousefunc_client_resize(struct client_ct
>   cc->geom.h = ev.xmotion.y;
>   client_applysizehints(cc);
>   client_resize(cc, 1);
> - mousefunc_sweep_draw(cc);
>   break;
>   case ButtonRelease:
>   client_resize(cc, 1);
>

I typically use the mouse for window resizes, for xterms it's useful
even to quickly see the dimensions even without resizing, ofc there
are other ways to glean that info.. but if it's not too horrible, I'd
like if it could stay.

-Bryan.



cwm: remove mouse resize window

2016-09-28 Thread Okan Demirmen
Hi,

Curious what the reaction might be if I removed the little geometry
window in the top-left corner for mouse/pointer based window resizes.

We currently print the x/y dimensions only for mouse based actions; we
don't for kbd, nor do we do anything with mouse/kbd window moves (such
as printing the x/y coordinates, etc). So why have mouse-resize be
different?  Thus, the below crudely removes it.

One reason to remove it is for simplicity; this is the only place we
need to hold and carry around menuwin and a drawable. If we abused
menuwin/drawable in other locations but the actual menu'ing subsystem,
then ok. Alternatively, can create/destroy each time for a mouse-resize,
but likely not worth it, maybe it should stay...

Thanks,
Okan

Index: mousefunc.c
===
RCS file: /home/open/cvs/xenocara/app/cwm/mousefunc.c,v
retrieving revision 1.107
diff -u -p -r1.107 mousefunc.c
--- mousefunc.c 28 Sep 2016 17:06:33 -  1.107
+++ mousefunc.c 28 Sep 2016 17:23:45 -
@@ -89,7 +89,6 @@ mousefunc_client_resize(struct client_ct
cc->geom.h = ev.xmotion.y;
client_applysizehints(cc);
client_resize(cc, 1);
-   mousefunc_sweep_draw(cc);
break;
case ButtonRelease:
client_resize(cc, 1);