diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/events.c | 15 | ||||
-rw-r--r-- | src/events.h | 2 | ||||
-rw-r--r-- | src/manage.c | 9 | ||||
-rw-r--r-- | src/messages.h | 2 |
4 files changed, 13 insertions, 15 deletions
diff --git a/src/events.c b/src/events.c index 084cf9c..9ea61a0 100644 --- a/src/events.c +++ b/src/events.c @@ -42,27 +42,28 @@ action.c which need to forward events to other windows. */ XEvent rp_current_event; +/* RAISED is non zero if a raised message should be used 0 for a map message. */ void -show_rudeness_raise_msg (rp_window *win) +show_rudeness_msg (rp_window *win, int raised) { rp_group *g = groups_find_group_by_window (win); rp_window_elem *elem = group_find_window (&g->mapped_windows, win); if (g == rp_current_group) { if (win->transient) - marked_message_printf (0, 0, MESSAGE_RAISE_TRANSIENT, + marked_message_printf (0, 0, raised ? MESSAGE_RAISE_TRANSIENT:MESSAGE_MAP_TRANSIENT, elem->number, window_name (win)); else - marked_message_printf (0, 0, MESSAGE_RAISE_WINDOW, + marked_message_printf (0, 0, raised ? MESSAGE_RAISE_WINDOW:MESSAGE_MAP_WINDOW, elem->number, window_name (win)); } else { if (win->transient) - marked_message_printf (0, 0, MESSAGE_RAISE_TRANSIENT_GROUP, + marked_message_printf (0, 0, raised ? MESSAGE_RAISE_TRANSIENT_GROUP:MESSAGE_MAP_TRANSIENT_GROUP, elem->number, window_name (win), g->name); else - marked_message_printf (0, 0, MESSAGE_RAISE_WINDOW_GROUP, + marked_message_printf (0, 0, raised ? MESSAGE_RAISE_WINDOW_GROUP:MESSAGE_MAP_WINDOW_GROUP, elem->number, window_name (win), g->name); } } @@ -196,7 +197,7 @@ map_request (XEvent *ev) || (rp_honour_normal_raise && !win->transient)) set_active_window (win); else - show_rudeness_raise_msg (win); + show_rudeness_msg (win, 1); } break; } @@ -268,7 +269,7 @@ configure_request (XConfigureRequestEvent *e) } else if (current_window() != win) { - show_rudeness_raise_msg (win); + show_rudeness_msg (win, 1); } } diff --git a/src/events.h b/src/events.h index 838249b..aa23692 100644 --- a/src/events.h +++ b/src/events.h @@ -23,4 +23,6 @@ #define _RATPOISON_EVENTS_H 1 void listen_for_events (); +void show_rudeness_msg (rp_window *win, int raised); + #endif /* _RATPOISON_EVENTS_H */ diff --git a/src/manage.c b/src/manage.c index d787c02..dd5eae9 100644 --- a/src/manage.c +++ b/src/manage.c @@ -839,14 +839,7 @@ map_window (rp_window *win) || (rp_honour_normal_map && !win->transient)) set_active_window (win); else - { - if (win->transient) - marked_message_printf (0, 0, MESSAGE_MAP_TRANSIENT, - win->number, window_name (win)); - else - marked_message_printf (0, 0, MESSAGE_MAP_WINDOW, - win->number, window_name (win)); - } + show_rudeness_msg (win, 0); } void diff --git a/src/messages.h b/src/messages.h index e8ec126..3e458b5 100644 --- a/src/messages.h +++ b/src/messages.h @@ -36,6 +36,8 @@ #define MESSAGE_RAISE_WINDOW_GROUP "Raise request from window %d (%s) in group %s" #define MESSAGE_MAP_TRANSIENT "New transient window %d (%s)" #define MESSAGE_MAP_WINDOW "New window %d (%s)" +#define MESSAGE_MAP_TRANSIENT_GROUP "New transient window %d (%s) in group %s" +#define MESSAGE_MAP_WINDOW_GROUP "New window %d (%s) in group %s" #define MESSAGE_PROMPT_SWITCH_TO_WINDOW "Switch to window: " #define MESSAGE_PROMPT_NEW_WINDOW_NAME "Set window's title to: " |