summaryrefslogtreecommitdiff
path: root/src/events.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-04-15 19:56:15 +0000
committersabetts <sabetts>2001-04-15 19:56:15 +0000
commitac84e85590a5a32c9db3979a4c05475e10d97a79 (patch)
tree6d2931bdabaa25260b8ee5c8430cd754283cf7e1 /src/events.c
parent58214c0d8b72ade928ce491da191af70d789e83b (diff)
downloadratpoison-ac84e85590a5a32c9db3979a4c05475e10d97a79.zip
* src/messages.h (MESSAGE_WELCOME): new define
* src/manage.c (scanwins): ignore the help window (hide_window): increment window's iconizing variable * src/main.c (main): display welcoming message (init_screen): create the help window (init_screen): don't map the frame indicator window (clean_up): destroy the help window * src/list.c (add_to_window_list): initialize iconizing to 0 * src/events.c (new_window): skip help_window (unmap_notify): skip normal processing if the event is from iconizing the window. (unmap_notify): clean up the window's frame if it is being withdrawn. * src/data.h (struct screen_info): new variable help_window * src/bar.c (update_window_names): only print the window list if the bar is already displaying the window list. * src/actions.h (cmd_help): new prototype (cmd_quit): likewise * src/actions.c (initialize_default_keybindings): new keybinding for "help" (cmd_quit): new function (cmd_help): likewise
Diffstat (limited to 'src/events.c')
-rw-r--r--src/events.c58
1 files changed, 32 insertions, 26 deletions
diff --git a/src/events.c b/src/events.c
index 8d48fdb..b6ba3e9 100644
--- a/src/events.c
+++ b/src/events.c
@@ -48,7 +48,7 @@ new_window (XCreateWindowEvent *e)
win = find_window (e->window);
if (s && !win && e->window != s->key_window && e->window != s->bar_window
- && e->window != s->input_window && e->window != s->frame_window)
+ && e->window != s->input_window && e->window != s->frame_window && e->window != s->help_window)
{
win = add_to_window_list (s, e->window);
update_window_information (win);
@@ -81,24 +81,30 @@ unmap_notify (XEvent *ev)
{
rp_window_frame *frame;
- /* If the window was inside a frame, fill the frame with another
- window. */
- frame = find_windows_frame (win);
- if (frame) cleanup_frame (frame);
-
- switch (win->state)
+ if (win->iconizing)
{
- case IconicState:
- /* This shouldn't actually happen, since the window is
- already unmapped, so do nothing */
- PRINT_DEBUG ("Iconizing iconized window '%s'\n", win->name);
- break;
- case NormalState:
- PRINT_DEBUG ("Withdrawing window '%s'\n", win->name);
- withdraw_window (win);
-/* hide_window (win); */
- if (frame == rp_current_frame) set_active_frame (frame);
- break;
+ /* This event is due to our hiding the window. */
+ win->iconizing--;
+ }
+ else
+ {
+ 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;
+ }
}
update_window_names (s);
@@ -138,10 +144,10 @@ map_request (XEvent *ev)
PRINT_DEBUG ("Mapped Window\n");
/* Its already mapped, so we don't have to do anything */
-/* maximize (win); */
-/* XMapRaised (dpy, win->w); */
-/* set_state (win, NormalState); */
-/* set_active_window (win); */
+ /* maximize (win); */
+ /* XMapRaised (dpy, win->w); */
+ /* set_state (win, NormalState); */
+ /* set_active_window (win); */
break;
case IconicState:
PRINT_DEBUG ("Mapped iconic window\n");
@@ -233,11 +239,11 @@ configure_request (XConfigureRequestEvent *e)
{
if (e->detail == Above)
{
- goto_window (win);
+/* goto_window (win); */
}
else if (e->detail == Below)
{
- set_active_window (find_window_other ());
+/* set_active_window (find_window_other ()); */
}
PRINT_DEBUG("request CWStackMode %d\n", e->detail);
@@ -344,9 +350,9 @@ handle_key (screen_info *s)
PRINT_DEBUG ("handling key...\n");
- /* All functions hide the program bar. Unless the bar doesn't time
- out. */
+ /* All functions hide the program bar and the frame indicator. */
if (BAR_TIMEOUT > 0) hide_bar (s);
+ hide_frame_indicator();
XGetInputFocus (dpy, &fwin, &revert);
XSetInputFocus (dpy, s->key_window, RevertToPointerRoot, CurrentTime);