ximagesink: set WM_CLASS of window
authorLuis de Bethencourt <luis.bg@samsung.com>
Fri, 5 Jun 2015 15:01:05 +0000 (16:01 +0100)
committerLuis de Bethencourt <luis.bg@samsung.com>
Mon, 8 Jun 2015 16:08:30 +0000 (17:08 +0100)
Set WM_CLASS of the ximagesink window so window managers can apply rules
based on xprop filtering.

sys/ximage/ximagesink.c

index 7814ac8..328a617 100644 (file)
@@ -378,6 +378,7 @@ gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
     /* we have a window */
     if (xwindow->internal) {
       XTextProperty xproperty;
+      XClassHint *hint = XAllocClassHint ();
       const gchar *app_name;
       const gchar *title = NULL;
       gchar *title_mem = NULL;
@@ -403,6 +404,13 @@ gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
 
         g_free (title_mem);
       }
+
+      if (hint) {
+        hint->res_name = g_strdup (app_name);
+        hint->res_class = g_strdup ("GStreamer");
+        XSetClassHint (ximagesink->xcontext->disp, xwindow->win, hint);
+      }
+      XFree (hint);
     }
   }
 }