about summary refs log tree commit diff stats
path: root/event.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-18 12:36:57 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-18 12:36:57 +0200
commit58f2fe3f6af3d6f8c925125c721a2d1800d750dc (patch)
tree71e4b4b1d6db1e837d4ad70db4c1598f67e2d534 /event.c
parent0aaa9a21f334a5c75b7efce2712384f57bd370cd (diff)
downloaddwm-58f2fe3f6af3d6f8c925125c721a2d1800d750dc.tar.gz
implemened distinguishing float/managed geometries of clients (works quite well)
Diffstat (limited to 'event.c')
-rw-r--r--event.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/event.c b/event.c
index 4b8c07b..db95dfd 100644
--- a/event.c
+++ b/event.c
@@ -62,8 +62,8 @@ movemouse(Client *c)
 	unsigned int dui;
 	Window dummy;
 
-	ocx = c->x;
-	ocy = c->y;
+	ocx = *c->x;
+	ocy = *c->y;
 	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
 				None, cursor[CurMove], CurrentTime) != GrabSuccess)
 		return;
@@ -77,8 +77,8 @@ movemouse(Client *c)
 			break;
 		case MotionNotify:
 			XSync(dpy, False);
-			c->x = ocx + (ev.xmotion.x - x1);
-			c->y = ocy + (ev.xmotion.y - y1);
+			*c->x = ocx + (ev.xmotion.x - x1);
+			*c->y = ocy + (ev.xmotion.y - y1);
 			resize(c, False);
 			break;
 		case ButtonRelease:
@@ -94,12 +94,12 @@ resizemouse(Client *c)
 	XEvent ev;
 	int ocx, ocy;
 
-	ocx = c->x;
-	ocy = c->y;
+	ocx = *c->x;
+	ocy = *c->y;
 	if(XGrabPointer(dpy, root, False, MouseMask, GrabModeAsync, GrabModeAsync,
 				None, cursor[CurResize], CurrentTime) != GrabSuccess)
 		return;
-	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w, c->h);
+	XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, *c->w, *c->h);
 	for(;;) {
 		XMaskEvent(dpy, MouseMask | ExposureMask, &ev);
 		switch(ev.type) {
@@ -109,10 +109,10 @@ resizemouse(Client *c)
 			break;
 		case MotionNotify:
 			XSync(dpy, False);
-			c->w = abs(ocx - ev.xmotion.x);
-			c->h = abs(ocy - ev.xmotion.y);
-			c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - c->w;
-			c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - c->h;
+			*c->w = abs(ocx - ev.xmotion.x);
+			*c->h = abs(ocy - ev.xmotion.y);
+			*c->x = (ocx <= ev.xmotion.x) ? ocx : ocx - *c->w;
+			*c->y = (ocy <= ev.xmotion.y) ? ocy : ocy - *c->h;
 			resize(c, True);
 			break;
 		case ButtonRelease:
@@ -187,13 +187,13 @@ configurerequest(XEvent *e)
 	if((c = getclient(ev->window))) {
 		gravitate(c, True);
 		if(ev->value_mask & CWX)
-			c->x = ev->x;
+			*c->x = ev->x;
 		if(ev->value_mask & CWY)
-			c->y = ev->y;
+			*c->y = ev->y;
 		if(ev->value_mask & CWWidth)
-			c->w = ev->width;
+			*c->w = ev->width;
 		if(ev->value_mask & CWHeight)
-			c->h = ev->height;
+			*c->h = ev->height;
 		if(ev->value_mask & CWBorderWidth)
 			c->border = 1;
 		gravitate(c, False);
96d0adca78212f5f9b584499e37bb0'>^
33352536 ^
9d27e966 ^
33352536 ^
9d27e966 ^
ecfbbfb5 ^
6602c82f ^
6030d7e2 ^
9d27e966 ^
33352536 ^
9d27e966 ^
33352536 ^
9d27e966 ^
33352536 ^
9d27e966 ^
7dac9ade ^
6602c82f ^
ecfbbfb5 ^

294a1520 ^
ee9a9237 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
                                                                                   
 
         

                                                                
 
       


                                                                                                                                                 
 

      
                             
                                                                                                                                                                         
 
                       
                      
                           
                                              
                                                                                                                                                                         
                          
                           
               
                                
 
                                  
                       
                           
                                        
                                                                                                                                                                         
                          
                           
               
                                 
 

                                
 
                            
# Read a character from stdin, save it to a local on the stack, write it to stdout.
#
# To run:
#   $ ./bootstrap translate init.linux apps/ex5.subx -o apps/ex5
#   $ ./bootstrap run apps/ex5

== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

Entry:

    # allocate x on the stack
    81          5/subop/subtract    3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # subtract from esp

    # read(stdin, x, 1)
    # . fd = 0 (stdin)
    bb/copy-to-ebx  0/imm32
    # . data = x (location to write result to)
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    4/base/esp  4/index/none              1/r32/ecx   4/disp8         .                 # copy esp+4 to ecx
    # . size = 1 character
    ba/copy-to-edx  1/imm32
    # . syscall
    e8/call  syscall_read/disp32

    # syscall(write, stdout, x, 1)
    # . fd = 1 (stdout)
    bb/copy-to-ebx  1/imm32
    # . data = x (location to read from)
    8d/copy-address                 1/mod/*+disp8   4/rm32/sib    4/base/esp  4/index/none              1/r32/ecx   4/disp8         .                 # copy esp+4 to ecx
    # . size = 1 character
    ba/copy-to-edx  1/imm32
    # . syscall
    e8/call  syscall_write/disp32

    # exit(ebx)
    e8/call  syscall_exit/disp32

# . . vim:nowrap:textwidth=0