From 0c8aca23eb94efe740acffc6c20ab73794da2218 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 14 Feb 2008 23:04:54 -0500 Subject: set the window type hint on menus to be "popup menus" --- openbox/menuframe.c | 5 +++++ openbox/prop.c | 1 + openbox/prop.h | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/openbox/menuframe.c b/openbox/menuframe.c index ce77fc0f..54f0cdbc 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -21,6 +21,7 @@ #include "client.h" #include "menu.h" #include "screen.h" +#include "prop.h" #include "actions.h" #include "grab.h" #include "openbox.h" @@ -89,6 +90,10 @@ ObMenuFrame* menu_frame_new(ObMenu *menu, guint show_from, ObClient *client) self->window = createWindow(RootWindow(ob_display, ob_screen), CWEventMask, &attr); + /* make it a popup menu type window */ + PROP_SET32(self->window, net_wm_window_type, atom, + prop_atoms.net_wm_window_type_popup_menu); + XSetWindowBorderWidth(ob_display, self->window, ob_rr_theme->mbwidth); XSetWindowBorder(ob_display, self->window, RrColorPixel(ob_rr_theme->menu_border_color)); diff --git a/openbox/prop.c b/openbox/prop.c index c2b0b40f..695e441f 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -112,6 +112,7 @@ void prop_startup(void) CREATE(net_wm_window_type_splash, "_NET_WM_WINDOW_TYPE_SPLASH"); CREATE(net_wm_window_type_dialog, "_NET_WM_WINDOW_TYPE_DIALOG"); CREATE(net_wm_window_type_normal, "_NET_WM_WINDOW_TYPE_NORMAL"); + CREATE(net_wm_window_type_popup_menu, "_NET_WM_WINDOW_TYPE_POPUP_MENU"); prop_atoms.net_wm_moveresize_size_topleft = 0; prop_atoms.net_wm_moveresize_size_top = 1; diff --git a/openbox/prop.h b/openbox/prop.h index 464fe26d..ae423271 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -86,6 +86,10 @@ typedef struct Atoms { Atom net_wm_bottomright; Atom net_wm_bottomleft; + /* types that we use but don't support */ + + Atom net_wm_window_type_popup_menu; + /* Everything below here must go in net_supported on the root window */ /* root window properties */ -- cgit v1.2.3 From 4b71209ec89902e2f88522603deeab8b240b34c3 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 15 Feb 2008 01:07:15 -0500 Subject: make the frame iconify animation go right into the icon geometry area instead of stopping before it --- openbox/frame.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/openbox/frame.c b/openbox/frame.c index 8fee3b69..3304f4b5 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -1694,7 +1694,7 @@ static gboolean frame_animate_iconify(gpointer p) g_get_current_time(&now); time = frame_animate_iconify_time_left(self, &now); - if (time == 0 || iconifying) { + if ((time > 0 && iconifying) || (time == 0 && !iconifying)) { /* start where the frame is supposed to be */ x = self->area.x; y = self->area.y; @@ -1725,12 +1725,11 @@ static gboolean frame_animate_iconify(gpointer p) h = self->size.top; /* just the titlebar */ } + XMoveResizeWindow(ob_display, self->window, x, y, w, h); + XFlush(ob_display); + if (time == 0) frame_end_iconify_animation(self); - else { - XMoveResizeWindow(ob_display, self->window, x, y, w, h); - XFlush(ob_display); - } return time > 0; /* repeat until we're out of time */ } -- cgit v1.2.3