Handle popups without a parent by setting the window manager hints

_NET_WM_STATE_SKIP_TASKBAR and _NET_WM_STATE_SKIP_PAGER. That seems to get
the behaviour we want.


git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/branches/seamlessrdp-branch/rdesktop@1136 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Pierre Ossman 2006-03-15 15:10:21 +00:00
parent 7c9b0860e8
commit f4cb53875c
3 changed files with 20 additions and 2 deletions

View File

@ -22,6 +22,7 @@
*/
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include "rdesktop.h"
#define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
@ -30,7 +31,8 @@
extern Display *g_display;
static Atom g_net_wm_state_maximized_vert_atom, g_net_wm_state_maximized_horz_atom,
g_net_wm_state_hidden_atom;
g_net_wm_state_hidden_atom, g_net_wm_state_skip_taskbar_atom,
g_net_wm_state_skip_pager_atom;
Atom g_net_wm_state_atom, g_net_wm_desktop_atom;
/*
@ -173,6 +175,9 @@ ewmh_init()
g_net_wm_state_maximized_horz_atom =
XInternAtom(g_display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
g_net_wm_state_hidden_atom = XInternAtom(g_display, "_NET_WM_STATE_HIDDEN", False);
g_net_wm_state_skip_taskbar_atom =
XInternAtom(g_display, "_NET_WM_STATE_SKIP_TASKBAR", False);
g_net_wm_state_skip_pager_atom = XInternAtom(g_display, "_NET_WM_STATE_SKIP_PAGER", False);
g_net_wm_state_atom = XInternAtom(g_display, "_NET_WM_STATE", False);
g_net_wm_desktop_atom = XInternAtom(g_display, "_NET_WM_DESKTOP", False);
}
@ -318,6 +323,14 @@ ewmh_move_to_desktop(Window wnd, unsigned int desktop)
return 0;
}
void
ewmh_set_window_popup(Window wnd)
{
Atom atoms[2] = { g_net_wm_state_skip_taskbar_atom, g_net_wm_state_skip_pager_atom };
XChangeProperty(g_display, wnd, g_net_wm_state_atom, XA_ATOM, 32, PropModeAppend, atoms, 2);
}
#endif /* MAKE_PROTO */

View File

@ -6,3 +6,4 @@ int ewmh_get_window_state(Window w);
int ewmh_change_state(Window wnd, int state);
int ewmh_move_to_desktop(Window wnd, unsigned int desktop);
int ewmh_get_window_desktop(Window wnd);
void ewmh_set_window_popup(Window wnd);

6
xwin.c
View File

@ -3084,7 +3084,7 @@ ui_seamless_create_window(unsigned long id, unsigned long parent, unsigned long
}
/* Set WM_TRANSIENT_FOR, if necessary */
if (parent)
if ((parent == 0x00000000) || (parent == 0xFFFFFFFF))
{
sw_parent = seamless_get_window_by_id(parent);
if (sw_parent)
@ -3093,6 +3093,10 @@ ui_seamless_create_window(unsigned long id, unsigned long parent, unsigned long
warning("ui_seamless_create_window: No parent window 0x%lx\n", parent);
}
/* Handle popups without parents through some ewm hints */
if (parent == 0xFFFFFFFF)
ewmh_set_window_popup(wnd);
/* FIXME: Support for Input Context:s */
get_input_mask(&input_mask);