Prechádzať zdrojové kódy

GTK dark titlebar

Set X11 Window Property for GTK darker titlebar. This pure cosmetic
patch makes the titlebar less intrusive when using the player in
windowed mode.

Plex-CLA-1.0-signed-off-by: Max Resch <resch.max@gmail.com>
Max Resch 5 rokov pred
rodič
commit
7997181415
1 zmenil súbory, kde vykonal 21 pridanie a 0 odobranie
  1. 21 0
      src/ui/KonvergoWindow.cpp

+ 21 - 0
src/ui/KonvergoWindow.cpp

@@ -21,6 +21,11 @@
 #include "Globals.h"
 #include "EventFilter.h"
 
+#ifdef Q_OS_UNIX
+#include <QX11Info>
+#include <X11/Xlib.h> 
+#endif
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 class ScopedDecrementer
 {
@@ -67,6 +72,22 @@ KonvergoWindow::KonvergoWindow(QWindow* parent) :
 #else
   setColor(QColor("#000000"));
 #endif
+ 
+#ifdef Q_OS_UNIX
+  // On Gnome show a darker title bar
+  if (QX11Info::isPlatformX11())
+  {
+    Display* dpy = QX11Info::display();
+    if (dpy)
+    {
+      WId win = winId();
+      XChangeProperty(dpy, win,
+                      XInternAtom(dpy, "_GTK_THEME_VARIANT", false),
+                      XInternAtom(dpy, "UTF8_STRING", false),
+                      8, PropModeReplace, (unsigned char *) "dark", 4);
+    }
+  }
+#endif
 
   QRect loadedGeo = loadGeometry();