]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Delegate GTK window creation to gtkmain.c.
authorSimon Tatham <anakin@pobox.com>
Wed, 23 Mar 2016 22:03:46 +0000 (22:03 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 23 Mar 2016 22:03:46 +0000 (22:03 +0000)
This is a weird thing to have to do, but it is necessary: the OS X
PuTTY will need its top-level windows to be instances of a thing
called GtkApplicationWindow, rather than plain GtkWindow. Hence, the
actual creation of windows needs to be somewhere that isn't
centralised between the two kinds of front end.

unix/gtkmain.c
unix/gtkwin.c
unix/unix.h

index eb731ea853a37efb9597019de7788a459a0c8f37..00db3464b6e48cb7703a9582710648d2d6a89811 100644 (file)
@@ -532,6 +532,11 @@ int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
     return err;
 }
 
+GtkWidget *make_gtk_toplevel_window(void *frontend)
+{
+    return gtk_window_new(GTK_WINDOW_TOPLEVEL);
+}
+
 extern int cfgbox(Conf *conf);
 
 int main(int argc, char **argv)
index 3ed58b08287a83e590f4aa08a1929b715a124fad..49db1fe5c2f7be9ad39dc0d556b934385ddf0ec3 100644 (file)
@@ -4120,7 +4120,7 @@ struct gui_data *new_session_window(Conf *conf, const char *geometry_string)
             exit(1);
         }
     }
-    inst->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+    inst->window = make_gtk_toplevel_window(inst);
     {
         const char *winclass = conf_get_str(inst->conf, CONF_winclass);
         if (*winclass)
index 3b8982c256a22e89b95c6f4f8a435018d73b6dc6..12ab8b1c164efebe1c4f4291708e7771f5d33412 100644 (file)
@@ -102,6 +102,9 @@ struct gui_data *new_session_window(Conf *conf, const char *geometry_string);
 void launch_duplicate_session(Conf *conf);
 void launch_new_session(void);
 void launch_saved_session(const char *str);
+#ifdef MAY_REFER_TO_GTK_IN_HEADERS
+GtkWidget *make_gtk_toplevel_window(void *frontend);
+#endif
 
 /* Defined in gtkcomm.c */
 void gtkcomm_setup(void);