@@ -9,6 +9,8 @@ static xcb_connection_t * dpy;
9
9
static xcb_screen_t * scre ;
10
10
static xcb_drawable_t win ;
11
11
static uint32_t values [3 ];
12
+ static uint32_t min_x = WINDOW_MIN_X ;
13
+ static uint32_t min_y = WINDOW_MIN_Y ;
12
14
13
15
static void killclient (char * * com ) {
14
16
xcb_kill_client (dpy , win );
@@ -57,10 +59,10 @@ static void handleMotionNotify(xcb_generic_event_t * ev) {
57
59
if ((values [2 ] == val [0 ]) && (win != 0 )) {
58
60
xcb_get_geometry_cookie_t geom_now = xcb_get_geometry (dpy , win );
59
61
xcb_get_geometry_reply_t * geom = xcb_get_geometry_reply (dpy , geom_now , NULL );
60
- values [0 ] = ((poin -> root_x + geom -> width + 2 * BORDER_WIDTH ) > scre -> width_in_pixels ) ?
61
- (scre -> width_in_pixels - geom -> width - 2 * BORDER_WIDTH ) : poin -> root_x ;
62
- values [1 ] = ((poin -> root_y + geom -> height + 2 * BORDER_WIDTH ) > scre -> height_in_pixels ) ?
63
- (scre -> height_in_pixels - geom -> height - 2 * BORDER_WIDTH ) : poin -> root_y ;
62
+ values [0 ] = ((poin -> root_x + geom -> width + ( 2 * BORDER_WIDTH ) ) > scre -> width_in_pixels ) ?
63
+ (scre -> width_in_pixels - geom -> width - ( 2 * BORDER_WIDTH ) ) : poin -> root_x ;
64
+ values [1 ] = ((poin -> root_y + geom -> height + ( 2 * BORDER_WIDTH ) ) > scre -> height_in_pixels ) ?
65
+ (scre -> height_in_pixels - geom -> height - ( 2 * BORDER_WIDTH ) ) : poin -> root_y ;
64
66
xcb_configure_window (dpy , win , XCB_CONFIG_WINDOW_X
65
67
| XCB_CONFIG_WINDOW_Y , values );
66
68
} else if ((values [2 ] == val [1 ]) && (win != 0 )) {
@@ -69,7 +71,7 @@ static void handleMotionNotify(xcb_generic_event_t * ev) {
69
71
if (!((poin -> root_x <= geom -> x ) || (poin -> root_y <= geom -> y ))) {
70
72
values [0 ] = poin -> root_x - geom -> x - BORDER_WIDTH ;
71
73
values [1 ] = poin -> root_y - geom -> y - BORDER_WIDTH ;
72
- if ((values [0 ] >= WINDOW_MIN_X ) && (values [1 ] >= WINDOW_MIN_Y )) {
74
+ if ((values [0 ] >= min_x ) && (values [1 ] >= min_y )) {
73
75
xcb_configure_window (dpy , win , XCB_CONFIG_WINDOW_WIDTH
74
76
| XCB_CONFIG_WINDOW_HEIGHT , values );
75
77
}
@@ -248,7 +250,7 @@ static int strcmp_c(char * str1, char * str2) {
248
250
int main (int argc , char * argv []) {
249
251
int ret = 0 ;
250
252
if ((argc == 2 ) && (strcmp_c ("-v" , argv [1 ]) == 0 )) {
251
- ret = die ("xwm-0.0.9 , © 2020 Michael Czigler, see LICENSE for details\n" );
253
+ ret = die ("xwm-0.1.0 , © 2020 Michael Czigler, see LICENSE for details\n" );
252
254
}
253
255
if ((ret == 0 ) && (argc != 1 )) {
254
256
ret = die ("usage: xwm [-v]\n" );
0 commit comments