[hackers] [wmii] Minimize the calls to focus_client on ButtonClick events (maybe this will fix the freeze)

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri Feb 09 06:10:42 2007

changeset: 1799:7358925b7aff
user: Kris Maglione <jg_AT_suckless.org>
date: Fri Feb 09 00:07:22 2007 -0500
summary: Minimize the calls to focus_client on ButtonClick events (maybe this will fix the freeze)

diff -r 6a1b1150e856 -r 7358925b7aff event.c
--- a/event.c Thu Feb 08 23:21:00 2007 -0500
+++ b/event.c Fri Feb 09 00:07:22 2007 -0500
@@ -64,8 +64,8 @@ buttonpress(XEvent *e) {
                         }
                 }else{
                         if(ev->button == Button1) {
- frame_to_top(f);
- focus(f->client, True);
+ if(frame_to_top(f) || f->client != sel_client)
+ focus(f->client, True);
                                 if(ispointinrect(ev->x, ev->y, &f->titlebar.rect)
                                  ||ispointinrect(ev->x, ev->y, &f->grabbox.rect))
                                         do_mouse_resize(f->client, CENTER);
diff -r 6a1b1150e856 -r 7358925b7aff frame.c
--- a/frame.c Thu Feb 08 23:21:00 2007 -0500
+++ b/frame.c Fri Feb 09 00:07:22 2007 -0500
@@ -95,19 +95,20 @@ resize_frame(Frame *f, XRectangle *r) {
                 match_sizehints(c, &f->rect, f->area->floating, stickycorner);
 }
 
-void
+Bool
 frame_to_top(Frame *f) {
         Frame **tf;
         Area *a;
 
         a = f->area;
- if(!a->floating)
- return;
+ if(!a->floating || f == a->stack)
+ return False;
         for(tf=&a->stack; *tf; tf=&(*tf)->snext)
                 if(*tf == f) break;
         *tf = f->snext;
         f->snext = a->stack;
         a->stack = f;
+ return True;
 }
 
 void
diff -r 6a1b1150e856 -r 7358925b7aff wmii.h
--- a/wmii.h Thu Feb 08 23:21:00 2007 -0500
+++ b/wmii.h Fri Feb 09 00:07:22 2007 -0500
@@ -322,7 +322,7 @@ extern void remove_frame(Frame *f);
 extern void remove_frame(Frame *f);
 extern void insert_frame(Frame *pos, Frame *f, Bool before);
 extern void resize_frame(Frame *f, XRectangle *r);
-extern void frame_to_top(Frame *f);
+extern Bool frame_to_top(Frame *f);
 extern void swap_frames(Frame *fa, Frame *fb);
 extern void draw_frame(Frame *f);
 extern void draw_frames();
Received on Fri Feb 09 2007 - 06:10:42 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:02 UTC