mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
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.
Thanks to:
Iain Patterson <wm@iain.cx>
This commit is contained in:
committed by
Carlos R. Mafra
parent
bf88570a5f
commit
1f1eb393f8
11
src/window.c
11
src/window.c
@@ -34,6 +34,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
|
||||
/* For getting mouse wheel mappings from WINGs */
|
||||
#include <WINGs/WINGsP.h>
|
||||
@@ -2858,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 = wwin->normal_hints->width_inc;
|
||||
resize_height_increment = 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;
|
||||
|
||||
Reference in New Issue
Block a user