summaryrefslogtreecommitdiffstats
path: root/client/x11/red_window.cpp
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-12-15 16:43:19 +0100
committerHans de Goede <hdegoede@redhat.com>2010-12-16 14:54:46 +0100
commit4081d67162bd34dc5b6a3cc574abd9aba760acd5 (patch)
tree4e4db95ba8262970d653ddd9821dd4da614e421f /client/x11/red_window.cpp
parente47fb5d74fb02f87c66a22105c08d6caa0571c1a (diff)
downloadspice-4081d67162bd34dc5b6a3cc574abd9aba760acd5.tar.gz
spice-4081d67162bd34dc5b6a3cc574abd9aba760acd5.tar.xz
spice-4081d67162bd34dc5b6a3cc574abd9aba760acd5.zip
spicec-x11: Add a class hint to our window managet hints
This helps people who want to tell their windowmanager to do something special with spicec, like make it sticky, or whatever, see: https://bugzilla.redhat.com/show_bug.cgi?id=662452#c4
Diffstat (limited to 'client/x11/red_window.cpp')
-rw-r--r--client/x11/red_window.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index 6e8cd584..569cf4e8 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -1213,6 +1213,7 @@ void RedWindow_p::create(RedWindow& red_window, PixelsSource_p& pix_source,
try {
int res;
+ XClassHint *class_hint;
XLockDisplay(x_display);
res = XSaveContext(x_display, window, user_data_context, (XPointer)&red_window);
@@ -1222,8 +1223,16 @@ void RedWindow_p::create(RedWindow& red_window, PixelsSource_p& pix_source,
}
XSetWMProtocols(x_display, window, &wm_delete_window_atom, 1);
- XGCValues gc_vals;
+ class_hint = XAllocClassHint();
+ if (!class_hint) {
+ THROW("allocating class hint failed");
+ }
+ class_hint->res_name = (char *)"spicec";
+ class_hint->res_class = (char *)"spicec";
+ XSetClassHint(x_display, window, class_hint);
+ XFree(class_hint);
+ XGCValues gc_vals;
XLockDisplay(x_display);
gc = XCreateGC(x_display, window, 0, &gc_vals);
XUnlockDisplay(x_display);