Set _NET_WM_NAME

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/branches/seamlessrdp-branch/rdesktop@1138 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Peter Åstrand 2006-03-15 15:16:18 +00:00
parent 2e0cc034a0
commit 661a93ab08
3 changed files with 22 additions and 2 deletions

View File

@ -30,9 +30,11 @@
#define _NET_WM_STATE_TOGGLE 2 /* toggle property */
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_skip_taskbar_atom,
g_net_wm_state_skip_pager_atom;
g_net_wm_state_hidden_atom, g_net_wm_name_atom, g_utf8_string_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;
/*
@ -170,6 +172,7 @@ get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height)
void
ewmh_init()
{
/* FIXME: Use XInternAtoms */
g_net_wm_state_maximized_vert_atom =
XInternAtom(g_display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
g_net_wm_state_maximized_horz_atom =
@ -180,6 +183,8 @@ ewmh_init()
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);
g_net_wm_name_atom = XInternAtom(g_display, "_NET_WM_NAME", False);
g_utf8_string_atom = XInternAtom(g_display, "UTF8_STRING", False);
}
@ -323,6 +328,17 @@ ewmh_move_to_desktop(Window wnd, unsigned int desktop)
return 0;
}
void
ewmh_set_wm_name(Window wnd, const char *title)
{
int len;
len = strlen(title);
XChangeProperty(g_display, wnd, g_net_wm_name_atom, g_utf8_string_atom,
8, PropModeReplace, (unsigned char *) title, len);
}
void
ewmh_set_window_popup(Window wnd)
{

View File

@ -6,4 +6,5 @@ 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_wm_name(Window wnd, const char *title);
void ewmh_set_window_popup(Window wnd);

3
xwin.c
View File

@ -3062,6 +3062,7 @@ ui_seamless_create_window(unsigned long id, unsigned long parent, unsigned long
CWBorderPixel, &attribs);
XStoreName(g_display, wnd, "SeamlessRDP");
ewmh_set_wm_name(wnd, "SeamlessRDP");
mwm_hide_decorations(wnd);
@ -3193,7 +3194,9 @@ ui_seamless_settitle(unsigned long id, const char *title, unsigned long flags)
return;
}
/* FIXME: Might want to convert the name for non-EWMH WMs */
XStoreName(g_display, sw->wnd, title);
ewmh_set_wm_name(sw->wnd, title);
}