On Mon 12.Oct'09 at 22:18:00 +0200, Johann Haarhoff wrote:
> On a difference note, it would be nice to be able to disable this on a  
> per-application basis. Google Earth uses Alt+Wheel for rotate, and I  
> think applications like Blender also have this mapped.

Isn't 

Attributes... -> Advanced Options -> Do not bind mouse clicks

the per-application config you want in this case?

> From: Johann Haarhoff <[email protected]>
> Date: Mon, 12 Oct 2009 21:48:45 +0200
> Subject: [PATCH] Mod+Wheel resize increment now respects size hints
> 
> Thanks to Iains patch which showed me how to access the window hints, I
> now propose the following: The resize increment is set to the closest
> multiple of the size hints larger than wPreferences.resize_increment.
> 
> This should fix Carlos' complaint about fixed-increment windows resizing
> too "slowly", and it also fixes my complaint about the blank space below
> the last line of an xterm.

Yes, now my xterms are "fast" again! Thanks!

> -             resize_width_increment = wwin->normal_hints->width_inc;
> -             resize_height_increment = wwin->normal_hints->height_inc;
> +             resize_width_increment = ceil(wPreferences.resize_increment / 
> wwin->normal_hints->width_inc) * wwin->normal_hints->width_inc;
> +             resize_height_increment = ceil(wPreferences.resize_increment / 
> wwin->normal_hints->height_inc) * wwin->normal_hints->height_inc;

...but these lines are way way too long, even for widescreens!
145 columns is simply too much, imho.

What do you think if I fold the patch below into yours before 
pushing your patch to the repo? Objections?


diff --git a/src/window.c b/src/window.c
index 126ad7f..500345b 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2859,14 +2859,16 @@ static void titlebarDblClick(WCoreWindow *sender, void 
*data, XEvent *event)
 static void frameMouseDown(WObjDescriptor *desc, XEvent *event)
 {
        WWindow *wwin = desc->parent;
-       unsigned int new_width;
-       unsigned int new_height;
+       unsigned int new_width, w_scale;
+       unsigned int new_height, h_scale;
        unsigned int resize_width_increment = 0;
        unsigned int resize_height_increment = 0;
 
        if (wwin->normal_hints) {
-               resize_width_increment = ceil(wPreferences.resize_increment / 
wwin->normal_hints->width_inc) * wwin->normal_hints->width_inc;
-               resize_height_increment = ceil(wPreferences.resize_increment / 
wwin->normal_hints->height_inc) * wwin->normal_hints->height_inc;
+               w_scale = ceil(wPreferences.resize_increment / 
wwin->normal_hints->width_inc);
+               h_scale = ceil(wPreferences.resize_increment / 
wwin->normal_hints->height_inc);
+               resize_width_increment = wwin->normal_hints->width_inc * 
w_scale;
+               resize_height_increment = wwin->normal_hints->height_inc * 
h_scale;
        }
        if (resize_width_increment <= 1 && resize_height_increment <= 1) {
                resize_width_increment = wPreferences.resize_increment;


-- 
To unsubscribe, send mail to [email protected].

Reply via email to