diff options
author | sabetts <sabetts> | 2001-06-02 10:12:52 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-06-02 10:12:52 +0000 |
commit | 981e11ac363e79419d08c158ceb0d257ee87a69b (patch) | |
tree | e8a5e649fe5dd3ade4c9a901118a992e82aa45c5 | |
parent | 2a84949a2adb5e342db8043512c3866f2e396e5b (diff) | |
download | ratpoison-981e11ac363e79419d08c158ceb0d257ee87a69b.zip |
* src/manage.c (hide_window): ignore unmap_notify events when
unmapping the window.
* src/list.c (add_to_window_list): use WIN_EVENTS in XSelectInput.
* src/data.h (struct rp_window): remove iconizing field. remove
code using iconizing.
(WIN_EVENTS): new define
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | src/data.h | 6 | ||||
-rw-r--r-- | src/events.c | 39 | ||||
-rw-r--r-- | src/list.c | 4 | ||||
-rw-r--r-- | src/manage.c | 5 |
5 files changed, 33 insertions, 32 deletions
@@ -1,3 +1,14 @@ +2001-06-02 shawn <sabetts@diggin.lamenet.tmp> + + * src/manage.c (hide_window): ignore unmap_notify events when + unmapping the window. + + * src/list.c (add_to_window_list): use WIN_EVENTS in XSelectInput. + + * src/data.h (struct rp_window): remove iconizing field. remove + code using iconizing. + (WIN_EVENTS): new define + 2001-06-01 shawn <sabetts@diggin.lamenet.tmp> * src/events.c (cleanup_frame): hide the frame's window's @@ -28,6 +28,8 @@ #define FONT_HEIGHT(f) ((f)->max_bounds.ascent + (f)->max_bounds.descent) +#define WIN_EVENTS (PropertyChangeMask | ColormapChangeMask | FocusChangeMask) + typedef struct rp_window rp_window; typedef struct screen_info screen_info; typedef struct rp_action rp_action; @@ -51,10 +53,6 @@ struct rp_window int state; int last_access; int named; - - /* An indication to unmap_notify that the event was produced by - iconizing a window. */ - int iconizing; /* Dimensions */ int x, y, width, height, border; diff --git a/src/events.c b/src/events.c index db5a41f..824b98e 100644 --- a/src/events.c +++ b/src/events.c @@ -100,31 +100,22 @@ unmap_notify (XEvent *ev) { rp_window_frame *frame; - if (win->iconizing) - { - /* This event is due to our hiding the window. */ - win->iconizing--; - } - else + switch (win->state) { - switch (win->state) - { - case IconicState: - PRINT_DEBUG ("Withdrawing iconized window '%s'\n", win->name); - if (ev->xunmap.send_event) withdraw_window (win); - break; - case NormalState: - PRINT_DEBUG ("Withdrawing normal window '%s'\n", win->name); - /* If the window was inside a frame, fill the frame with another - window. */ - frame = find_windows_frame (win); - if (frame) cleanup_frame (frame); - if (frame == rp_current_frame) set_active_frame (frame); - - - withdraw_window (win); - break; - } + case IconicState: + PRINT_DEBUG ("Withdrawing iconized window '%s'\n", win->name); + if (ev->xunmap.send_event) withdraw_window (win); + break; + case NormalState: + PRINT_DEBUG ("Withdrawing normal window '%s'\n", win->name); + /* If the window was inside a frame, fill the frame with another + window. */ + frame = find_windows_frame (win); + if (frame) cleanup_frame (frame); + if (frame == rp_current_frame) set_active_frame (frame); + + withdraw_window (win); + break; } update_window_names (s); @@ -65,7 +65,6 @@ add_to_window_list (screen_info *s, Window w) new_window->last_access = 0; new_window->prev = NULL; new_window->state = WithdrawnState; - new_window->iconizing = 0; new_window->number = -1; new_window->named = 0; new_window->hints = XAllocSizeHints (); @@ -75,8 +74,7 @@ add_to_window_list (screen_info *s, Window w) get_mouse_root_position (new_window, &new_window->mouse_x, &new_window->mouse_y); - XSelectInput (dpy, new_window->w, - PropertyChangeMask | ColormapChangeMask | FocusChangeMask); + XSelectInput (dpy, new_window->w, WIN_EVENTS); new_window->name = xmalloc (strlen ("Unnamed") + 1); diff --git a/src/manage.c b/src/manage.c index e611b1f..8a7effc 100644 --- a/src/manage.c +++ b/src/manage.c @@ -500,9 +500,12 @@ hide_window (rp_window *win) { if (win == NULL) return; + /* Ignore the unmap_notify event. */ + XSelectInput(dpy, win->w, + WIN_EVENTS&~(StructureNotifyMask|EnterWindowMask)); XUnmapWindow (dpy, win->w); + XSelectInput (dpy, win->w, WIN_EVENTS); set_state (win, IconicState); - win->iconizing++; } void |