]> git.mdlowis.com Git - proto/windowlab.git/commitdiff
remove debug stuff
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 23 May 2019 03:08:46 +0000 (23:08 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 23 May 2019 03:08:46 +0000 (23:08 -0400)
client.c
events.c
main.c
manage.c
misc.c
windowlab.h

index 4455168cdb9ca315c383667b4bc670b8ed0931a2..46fa54b43ab334969635a59d8f6cb76cbbc7d65b 100644 (file)
--- a/client.c
+++ b/client.c
@@ -122,10 +122,6 @@ void remove_client(Client *c, int mode)
     XGrabServer(dsply);
     XSetErrorHandler(ignore_xerror);
 
-#ifdef DEBUG
-    err("removing %s, %d: %d left", c->name, mode, XPending(dsply));
-#endif
-
     if (mode == WITHDRAW)
     {
         set_wm_state(c, WithdrawnState);
@@ -163,10 +159,6 @@ void remove_client(Client *c, int mode)
     {
         XFree(c->size);
     }
-    if (c == fullscreen_client)
-    {
-        fullscreen_client = NULL;
-    }
     if (c == focused_client)
     {
         focused_client = NULL;
@@ -181,10 +173,6 @@ void remove_client(Client *c, int mode)
 
 void redraw(Client *c)
 {
-    if (c == fullscreen_client)
-    {
-        return;
-    }
     XDrawLine(dsply, c->frame, border_gc, 0, BARHEIGHT() - DEF_BORDERWIDTH + DEF_BORDERWIDTH / 2, c->width, BARHEIGHT() - DEF_BORDERWIDTH + DEF_BORDERWIDTH / 2);
     // clear text part of bar
     if (c == focused_client)
index 50a06afaddc6fc15b3ff2d2a99d2d71a96c39a11..31943ec76b316cb5b72e2c09c97561465957cfef 100644 (file)
--- a/events.c
+++ b/events.c
@@ -46,9 +46,6 @@ void do_event_loop(void)
     for (;;)
     {
         interruptible_XNextEvent(&ev);
-#ifdef DEBUG
-        show_event(ev);
-#endif
         switch (ev.type)
         {
             case ButtonPress:
@@ -93,28 +90,22 @@ static void handle_button_press(XButtonEvent *e)
 
     if (e->state & MODIFIER)
     {
-        if (focused_client != NULL && focused_client != fullscreen_client)
-        {
+        if (focused_client != NULL)
             resize(focused_client, e->x_root, e->y_root);
-        }
-        else
-        {
-            // pass event on
+        else // pass event on
             XAllowEvents(dsply, ReplayPointer, CurrentTime);
-        }
     }
     else
     {
         // pass event on
         XAllowEvents(dsply, ReplayPointer, CurrentTime);
-        if (e->button == Button1)
-        {
+        if (e->button == Button1) {
             c = find_client(e->window, FRAME);
             if (c != NULL)
             {
                 // click-to-focus
                 check_focus(c);
-                if (e->y < BARHEIGHT() && c != fullscreen_client)
+                if (e->y < BARHEIGHT())
                 {
                     handle_windowbar_click(e, c);
                 }
@@ -216,9 +207,8 @@ static unsigned int box_clicked(Client *c, int x)
 
 static void draw_button(Client *c, GC *detail_gc, GC *background_gc, unsigned int which_box)
 {
-    if (which_box == 0) {
+    if (which_box == 0)
         draw_close_button(c, detail_gc, background_gc);
-    }
 }
 
 /* Because we are redirecting the root window, we get ConfigureRequest
@@ -245,27 +235,6 @@ static void handle_configure_request(XConfigureRequestEvent *e)
     Client *c = find_client(e->window, WINDOW);
     XWindowChanges wc;
 
-    if (fullscreen_client != NULL && c == fullscreen_client)
-    {
-        if (e->value_mask & CWX)
-        {
-            fs_prevdims.x = e->x;
-        }
-        if (e->value_mask & CWY)
-        {
-            fs_prevdims.y = e->y;
-        }
-        if (e->value_mask & CWWidth)
-        {
-            fs_prevdims.width = e->width;
-        }
-        if (e->value_mask & CWHeight)
-        {
-            fs_prevdims.height = e->height;
-        }
-        return;
-    }
-
     if (c != NULL)
     {
         gravitate(c, REMOVE_GRAVITY);
diff --git a/main.c b/main.c
index 5696be248cdf6bc97129fcda35cebdcbb2b5c05f..517c2acb719d6b162b44397ec18a3120ee14241d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -33,7 +33,7 @@ GC string_gc, border_gc, text_gc, active_gc, depressed_gc, inactive_gc, selected
 XColor border_col, text_col, active_col, depressed_col, inactive_col, selected_col, empty_col;
 Cursor resize_curs;
 Atom wm_state, wm_change_state, wm_protos, wm_delete, wm_cmapwins;
-Client *head_client = NULL, *focused_client = NULL, *topmost_client = NULL, *fullscreen_client = NULL;
+Client *head_client = NULL, *focused_client = NULL, *topmost_client = NULL;
 unsigned int focus_count = 0;
 Rect fs_prevdims;
 char *opt_font = DEF_FONT;
@@ -148,9 +148,6 @@ static void setup_display(void)
             if (modmap->modifiermap[i * modmap->max_keypermod + j] == XKeysymToKeycode(dsply, XK_Num_Lock))
             {
                 numlockmask = (1 << i);
-#ifdef DEBUG
-                fprintf(stderr, "setup_display() : XK_Num_Lock is (1<<0x%02x)\n", i);
-#endif
             }
         }
     }
index 26879d3b341e55c7809eeb60bbf0aea4d123145d..ad6a74f7fc8566117e2e239b469d412fbd027ef3 100644 (file)
--- a/manage.c
+++ b/manage.c
@@ -90,9 +90,6 @@ void move(Client *c)
     bounddims.height += c->height - ((BARHEIGHT() * 2) - DEF_BORDERWIDTH);
 
     constraint_win = XCreateWindow(dsply, root, bounddims.x, bounddims.y, bounddims.width, bounddims.height, 0, CopyFromParent, InputOnly, CopyFromParent, 0, &pattr);
-#ifdef DEBUG
-    fprintf(stderr, "move() : constraint_win is (%d, %d)-(%d, %d)\n", bounddims.x, bounddims.y, bounddims.x + bounddims.width, bounddims.y + bounddims.height);
-#endif
     XMapWindow(dsply, constraint_win);
 
     if (!(XGrabPointer(dsply, root, False, MouseMask, GrabModeAsync, GrabModeAsync, constraint_win, None, CurrentTime) == GrabSuccess))
diff --git a/misc.c b/misc.c
index c30be84b8528ddbd7e28372a44d8a9bb1db36609..1d57feebba3eb95f819c7415700cc4e04d32dca0 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -165,11 +165,7 @@ void fix_position(Client *c)
     int ymax = DisplayHeight(dsply, screen);
     int titlebarheight;
 
-#ifdef DEBUG
-    fprintf(stderr, "fix_position(): client was (%d, %d)-(%d, %d)\n", c->x, c->y, c->x + c->width, c->y + c->height);
-#endif
-
-    titlebarheight = (fullscreen_client == c) ? 0 : BARHEIGHT();
+    titlebarheight = BARHEIGHT();
 
     if (c->width < MINWINWIDTH)
     {
@@ -207,10 +203,6 @@ void fix_position(Client *c)
         c->y = (ymax - c->height) - BARHEIGHT();
     }
 
-#ifdef DEBUG
-    fprintf(stderr, "fix_position(): client is (%d, %d)-(%d, %d)\n", c->x, c->y, c->x + c->width, c->y + c->height);
-#endif
-
     c->x -= BORDERWIDTH(c);
     c->y -= BORDERWIDTH(c);
 }
@@ -249,118 +241,6 @@ void copy_dims(Rect *sourcedims, Rect *destdims)
     destdims->height = sourcedims->height;
 }
 
-#ifdef DEBUG
-
-/* Bleh, stupid macro names. I'm not feeling creative today. */
-
-#define SHOW_EV(name, memb) \
-    case name: \
-        s = #name; \
-        w = e.memb.window; \
-        break;
-#define SHOW(name) \
-    case name: \
-        return #name;
-
-void show_event(XEvent e)
-{
-    char *s, buf[20];
-    Window w;
-    Client *c;
-
-    switch (e.type)
-    {
-        SHOW_EV(ButtonPress, xbutton)
-        SHOW_EV(ButtonRelease, xbutton)
-        SHOW_EV(ClientMessage, xclient)
-        SHOW_EV(ColormapNotify, xcolormap)
-        SHOW_EV(ConfigureNotify, xconfigure)
-        SHOW_EV(ConfigureRequest, xconfigurerequest)
-        SHOW_EV(CreateNotify, xcreatewindow)
-        SHOW_EV(DestroyNotify, xdestroywindow)
-        SHOW_EV(EnterNotify, xcrossing)
-        SHOW_EV(Expose, xexpose)
-        SHOW_EV(MapNotify, xmap)
-        SHOW_EV(MapRequest, xmaprequest)
-        SHOW_EV(MappingNotify, xmapping)
-        SHOW_EV(MotionNotify, xmotion)
-        SHOW_EV(PropertyNotify, xproperty)
-        SHOW_EV(ReparentNotify, xreparent)
-        SHOW_EV(ResizeRequest, xresizerequest)
-        SHOW_EV(UnmapNotify, xunmap)
-        default:
-            if (shape && e.type == shape_event)
-            {
-                s = "ShapeNotify";
-                w = ((XShapeEvent *)&e)->window;
-            }
-            else
-            {
-                s = "unknown event";
-                w = None;
-            }
-            break;
-    }
-
-    c = find_client(w, WINDOW);
-    snprintf(buf, sizeof buf, c != NULL ? c->name : "(none)");
-    err("%#-10lx: %-20s: %s", w, buf, s);
-}
-
-static const char *show_state(Client *c)
-{
-    switch (get_wm_state(c))
-    {
-        SHOW(WithdrawnState)
-        SHOW(NormalState)
-        SHOW(IconicState)
-        default: return "unknown state";
-    }
-}
-
-static const char *show_grav(Client *c)
-{
-    if (c->size == NULL || !(c->size->flags & PWinGravity))
-    {
-        return "no grav (NW)";
-    }
-
-    switch (c->size->win_gravity)
-    {
-        SHOW(UnmapGravity)
-        SHOW(NorthWestGravity)
-        SHOW(NorthGravity)
-        SHOW(NorthEastGravity)
-        SHOW(WestGravity)
-        SHOW(CenterGravity)
-        SHOW(EastGravity)
-        SHOW(SouthWestGravity)
-        SHOW(SouthGravity)
-        SHOW(SouthEastGravity)
-        SHOW(StaticGravity)
-        default: return "unknown grav";
-    }
-}
-
-void dump(Client *c)
-{
-    if (c != NULL)
-    {
-        err("%s\n\t%s, %s, ignore %d, was_hidden %d\n\tframe %#lx, win %#lx, geom %dx%d+%d+%d", c->name, show_state(c), show_grav(c), c->ignore_unmap, c->was_hidden, c->frame, c->window, c->width, c->height, c->x, c->y);
-    }
-}
-
-void dump_clients(void)
-{
-    Client *c = head_client;
-    while (c != NULL)
-    {
-        dump(c);
-        c = c->next;
-    }
-}
-#endif
-
 /* We use XQueryTree here to preserve the window stacking order,
  * since the order in our linked list is different. */
 
index e00454005ad2c9c656bff7f77af0108eb5f218de..b6499f44f8d0fe738e4499441736ab63c267543f 100644 (file)
@@ -236,10 +236,5 @@ extern void get_mouse_position(int *, int *);
 extern void fix_position(Client *);
 extern void refix_position(Client *, XConfigureRequestEvent *);
 extern void copy_dims(Rect *, Rect *);
-#ifdef DEBUG
-extern void show_event(XEvent);
-extern void dump(Client *);
-extern void dump_clients(void);
-#endif
 
 #endif /* WINDOWLAB_H */