diff options
author | sabetts <sabetts> | 2002-01-24 04:58:38 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2002-01-24 04:58:38 +0000 |
commit | 6d3fb32f4c38bc9a49a198a0724f371ae7bc2862 (patch) | |
tree | f8b1d81b51192327272eca6d1b61bc6fb2996f43 | |
parent | 159f215b904cd6db22ce3726413462a7c1499ac5 (diff) | |
download | ratpoison-6d3fb32f4c38bc9a49a198a0724f371ae7bc2862.zip |
* src/events.c (configure_notify): remove function
(delegate_event): add ConfigureNotify to the ignored events list.
* src/manage.c (update_normal_hints): improve debugging output.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/events.c | 56 | ||||
-rw-r--r-- | src/manage.c | 4 |
3 files changed, 38 insertions, 29 deletions
@@ -1,3 +1,10 @@ +2002-01-23 Shawn <sabetts@vcn.bc.ca> + + * src/events.c (configure_notify): remove function + (delegate_event): add ConfigureNotify to the ignored events list. + + * src/manage.c (update_normal_hints): improve debugging output. + 2002-01-17 Gergely Nagy <algernon@debian.org> * debian/changelog: update for a new snapshot diff --git a/src/events.c b/src/events.c index a289d93..7127669 100644 --- a/src/events.c +++ b/src/events.c @@ -216,25 +216,6 @@ destroy_window (XDestroyWindowEvent *ev) } static void -configure_notify (XConfigureEvent *e) -{ - rp_window *win; - - win = find_window (e->window); - if (win && win->state == NormalState) - { - if (win->height != e->height - || win->width != e->width - || win->border != e->border_width - || win->x != e->x - || win->y != e->y) - /* The notify event was generated from a granted configure - request which means we must re-maximize the window. */ - maximize (win); - } -} - -static void configure_request (XConfigureRequestEvent *e) { int border; @@ -314,10 +295,33 @@ configure_request (XConfigureRequestEvent *e) if (e->value_mask & (CWX|CWY|CWBorderWidth|CWWidth|CWHeight)) { - /* Always grant it whatever it likes. We will catch it the - ConfigureNotify event and maximize the window there. */ - XConfigureWindow (dpy, win->w, e->value_mask & (CWX|CWY|CWBorderWidth|CWWidth|CWHeight), - &changes); + if (win->state == NormalState) + { + /* Draw the hardline. Visible windows always maximize. */ + maximize (win); + } + else + { + /* The window isn't visible so grant it whatever it + likes. */ + XConfigureWindow (dpy, win->w, + e->value_mask & (CWX|CWY|CWBorderWidth|CWWidth|CWHeight), + &changes); + + /* Update the window's structure. */ + if (e->value_mask & CWX) + win->x = changes.x; + if (e->value_mask & CWY) + win->y = changes.y; + if (e->value_mask & CWBorderWidth) + win->border = border; + if (e->value_mask & CWWidth) + win->width = changes.width; + if (e->value_mask & CWHeight) + win->height = changes.height; + } + + /* This is required to be ICCCM compliant. */ send_configure (win); } } @@ -743,16 +747,12 @@ delegate_event (XEvent *ev) focus_change (&ev->xfocus); break; - case ConfigureNotify: - PRINT_DEBUG ("--- Handling ConfigureNotify ---\n"); - configure_notify (&ev->xconfigure); - break; - case MappingNotify: PRINT_DEBUG ("--- Handling MappingNotify ---\n"); mapping_notify( &ev->xmapping ); break; + case ConfigureNotify: case MapNotify: case Expose: case MotionNotify: diff --git a/src/manage.c b/src/manage.c index 20356c3..f1ac058 100644 --- a/src/manage.c +++ b/src/manage.c @@ -84,7 +84,9 @@ update_normal_hints (rp_window *win) PRINT_DEBUG ("maxx: %d maxy: %d ", win->hints->max_width, win->hints->max_height); if (win->hints->flags & PResizeInc) - PRINT_DEBUG ("incx: %d incy: %d\n", win->hints->width_inc, win->hints->height_inc); + PRINT_DEBUG ("incx: %d incy: %d", win->hints->width_inc, win->hints->height_inc); + + PRINT_DEBUG ("\n"); #endif } |