Skip to content

Commit

Permalink
#9631: Hint GNOME 3 window manager to use dark window borders
Browse files Browse the repository at this point in the history
  • Loading branch information
pmjdebruijn authored and Pascal de Bruijn committed Oct 30, 2013
1 parent 071f11a commit 56d6762
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include <math.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <gdk/gdkx.h>
#include <X11/Xatom.h>
#ifdef MAC_INTEGRATION
# include <gtkosxapplication.h>
#endif
Expand Down Expand Up @@ -658,6 +660,13 @@ window_configure (GtkWidget *da, GdkEvent *event, gpointer user_data)
return FALSE;
}

static gboolean
window_realize (GtkWidget *da, gpointer user_data)
{
gdk_property_change(GDK_WINDOW(da), gdk_atom_intern("_GTK_THEME_VARIANT", FALSE), (GdkAtom)XA_STRING, 8, GDK_PROP_MODE_REPLACE, (guchar *)"dark", 4);
return FALSE;
}

static gboolean
key_pressed_override (GtkWidget *w, GdkEventKey *event, gpointer user_data)
{
Expand Down Expand Up @@ -897,6 +906,9 @@ dt_gui_gtk_init(dt_gui_gtk_t *gui, int argc, char *argv[])
widget = dt_ui_main_window(darktable.gui->ui);
g_signal_connect (G_OBJECT (widget), "configure-event", G_CALLBACK (window_configure), NULL);

// Hint GNOME 3 window manager to use dark window borders
g_signal_connect (G_OBJECT (widget), "realize", G_CALLBACK(window_realize), NULL);

// register keys for view switching
dt_accel_register_global(NC_("accel", "capture view"), GDK_KEY_t, 0);
dt_accel_register_global(NC_("accel", "lighttable view"), GDK_KEY_l, 0);
Expand Down

0 comments on commit 56d6762

Please sign in to comment.