Commit 1ea16c18f5f9a4616f203ecbd7d59ea7fca8fedc

Authored by Perry Werneck
1 parent a5f092d2

Adding registry option for gtk-csd.

schemas/windows/application.gschema.xml.in
... ... @@ -38,6 +38,12 @@
38 38 <description>The ID of the current user interface style</description>
39 39 </key>
40 40  
  41 + <key name="gtk-csd" type="i">
  42 + <default>-1</default>
  43 + <summary>GTK CSD</summary>
  44 + <description>Gtk Client side decorations</description>
  45 + </key>
  46 +
41 47 </schema>
42 48  
43 49 </schemalist>
... ...
src/main/main.c
... ... @@ -89,9 +89,6 @@ int main (int argc, char **argv) {
89 89 g_autofree gchar * appdir = g_win32_get_package_installation_directory_of_module(NULL);
90 90 g_autofree gchar * locdir = g_build_filename(appdir,"locale",NULL);
91 91 bindtextdomain( PACKAGE_NAME, locdir );
92   -
93   - // https://stackoverflow.com/questions/37035936/how-to-get-native-windows-decorations-on-gtk3-on-windows-7-and-msys2
94   - putenv("GTK_CSD=0");
95 92 }
96 93 #endif // _WIN32
97 94  
... ...
src/objects/application/application.c
... ... @@ -207,6 +207,13 @@
207 207  
208 208 g_settings_schema_source_unref(source);
209 209  
  210 + // https://stackoverflow.com/questions/37035936/how-to-get-native-windows-decorations-on-gtk3-on-windows-7-and-msys2
  211 + int gtk_csd = g_settings_get_int(app->settings,"gtk-csd");
  212 + if(gtk_csd != -1) {
  213 + g_autofree gchar * env = g_strdup_printf("GTK_CSD=%d",gtk_csd);
  214 + putenv(env);
  215 + }
  216 +
210 217 #else
211 218  
212 219 app->settings = g_settings_new_with_path("br.com.bb." PACKAGE_NAME, path);
... ...