ui/motif/toolkit.c

changeset 99
ea1a2d5de765
parent 86
3c63f57a8f77
child 122
e82b01d17a78
--- a/ui/motif/toolkit.c	Mon Nov 30 14:09:55 2015 +0100
+++ b/ui/motif/toolkit.c	Tue Jan 12 17:41:08 2016 +0100
@@ -166,6 +166,7 @@
 void ui_show(UiObject *obj) {
     uic_check_group_widgets(obj->ctx);
     XtRealizeWidget(obj->widget);
+    ui_window_dark_theme(XtDisplay(obj->widget), XtWindow(obj->widget)); // TODO: if
 }
 
 // implemented in window.c
@@ -293,3 +294,17 @@
 Widget ui_get_active_window() {
     return active_window;
 }
+
+void ui_window_dark_theme(Display *dp, Window window) {
+    Atom atom = XInternAtom(dp, "_GTK_THEME_VARIANT", False);
+    Atom type = XInternAtom(dp, "UTF8_STRING", False);
+    XChangeProperty(
+            dp, 
+            window, 
+            atom,
+            type,
+            8,
+            PropModeReplace,
+            "dark",
+            4);
+}

mercurial