/[svn]/gigedit/trunk/src/gigedit/main.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/main.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3191 by persson, Sun Sep 15 13:31:04 2013 UTC revision 3192 by schoenebeck, Fri May 19 18:09:37 2017 UTC
# Line 17  Line 17 
17   * 02110-1301 USA.   * 02110-1301 USA.
18   */   */
19    
20    #if HAVE_CONFIG_H
21    # include <config.h>
22    #endif
23    
24    #include <gtk/gtk.h>
25  #include "gigedit.h"  #include "gigedit.h"
26    #include <gtkmm.h>
27    
28    #if GTKMM_MAJOR_VERSION >= 3
29    
30    /**
31     * This is required since GTK 3, because those GTK super heros came up with
32     * the clever idea to simply disable things like icons and keyboard shortcuts
33     * for menus and for buttons by default for all users, all devices and all
34     * apps. Yey! Seriously, I have no idea what came on their mind to find that
35     * was a good idea!
36     */
37    static void enforceGtk3Settings(int argc, char* argv[]) {
38        gtk_init(&argc, &argv);
39    
40        // got not behavior change on those 2 settings, so ignoring them for now,
41        // actually I though I could use them to show the mnemonics in the GTK 3
42        // menus again, but it seems that was entirely removed from around GTK 3.10.
43        //g_object_set(gtk_settings_get_default(), "gtk-auto-mnemonics", false, NULL);
44        //g_object_set(gtk_settings_get_default(), "gtk-can-change-accels", true, NULL);
45    
46        // bring back keyboard accelerators with GTK 3
47        g_object_set(gtk_settings_get_default(), "gtk-enable-accels", true, NULL);
48        g_object_set(gtk_settings_get_default(), "gtk-enable-mnemonics", true, NULL);
49    
50        // bring back icons with GTK 3
51        g_object_set(gtk_settings_get_default(), "gtk-menu-images", true, NULL);
52        g_object_set(gtk_settings_get_default(), "gtk-button-images", true, NULL);
53    
54        // who knows ... one day those GTK "masterminds" decide to disable tooltips by default as well
55        g_object_set(gtk_settings_get_default(), "gtk-enable-tooltips", true, NULL);
56    }
57    
58    #endif // GTKM 3
59    
60  #if defined(WIN32)  #if defined(WIN32)
61  #include <windows.h>  #include <windows.h>
# Line 25  Line 63 
63  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,  int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
64      LPSTR lpCmdLine, int nCmdShow)      LPSTR lpCmdLine, int nCmdShow)
65  {  {
66        #if GTKMM_MAJOR_VERSION >= 3
67        enforceGtk3Settings(__argc, __argv);
68        #endif
69    
70      GigEdit app;      GigEdit app;
71      return app.run(__argc, __argv);      return app.run(__argc, __argv);
72  }  }
# Line 33  int WINAPI WinMain(HINSTANCE hInstance, Line 75  int WINAPI WinMain(HINSTANCE hInstance,
75    
76  int main(int argc, char* argv[])  int main(int argc, char* argv[])
77  {  {
78        #if GTKMM_MAJOR_VERSION >= 3
79        enforceGtk3Settings(argc, argv);
80        #endif
81    
82  #ifdef __APPLE__  #ifdef __APPLE__
83      // remove the argument added by the OS      // remove the argument added by the OS
84      if (argc > 1 && strncmp(argv[1], "-psn", 4) == 0) {      if (argc > 1 && strncmp(argv[1], "-psn", 4) == 0) {

Legend:
Removed from v.3191  
changed lines
  Added in v.3192

  ViewVC Help
Powered by ViewVC