diff options
-rw-r--r-- | gnunet-gtk.glade | 4 | ||||
-rw-r--r-- | src/common/helper.c | 20 | ||||
-rw-r--r-- | src/core/eggtrayicon.c | 8 | ||||
-rw-r--r-- | src/include/gnunetgtk_common.h | 13 |
4 files changed, 42 insertions, 3 deletions
diff --git a/gnunet-gtk.glade b/gnunet-gtk.glade index e00514c2..b55fba29 100644 --- a/gnunet-gtk.glade +++ b/gnunet-gtk.glade | |||
@@ -22,6 +22,7 @@ | |||
22 | <property name="focus_on_map">True</property> | 22 | <property name="focus_on_map">True</property> |
23 | <property name="urgency_hint">False</property> | 23 | <property name="urgency_hint">False</property> |
24 | <signal name="delete_event" handler="gnunet_gtk_main_quit" after="yes" last_modification_time="Tue, 23 Aug 2005 07:30:53 GMT"/> | 24 | <signal name="delete_event" handler="gnunet_gtk_main_quit" after="yes" last_modification_time="Tue, 23 Aug 2005 07:30:53 GMT"/> |
25 | <signal name="window_state_event" handler="saveMainWindowState" after="yes" last_modification_time="Tue, 30 May 2006 20:04:10 GMT"/> | ||
25 | 26 | ||
26 | <child> | 27 | <child> |
27 | <widget class="GtkVBox" id="vbox1"> | 28 | <widget class="GtkVBox" id="vbox1"> |
@@ -2564,7 +2565,8 @@ This release fixes downloads of files from directories. The previous version ha | |||
2564 | <child> | 2565 | <child> |
2565 | <widget class="GtkImage" id="image28"> | 2566 | <widget class="GtkImage" id="image28"> |
2566 | <property name="visible">True</property> | 2567 | <property name="visible">True</property> |
2567 | <property name="pixbuf">gnunet-gtk-advanced.png</property> | 2568 | <property name="stock">gtk-execute</property> |
2569 | <property name="icon_size">4</property> | ||
2568 | <property name="xalign">0.5</property> | 2570 | <property name="xalign">0.5</property> |
2569 | <property name="yalign">0.5</property> | 2571 | <property name="yalign">0.5</property> |
2570 | <property name="xpad">0</property> | 2572 | <property name="xpad">0</property> |
diff --git a/src/common/helper.c b/src/common/helper.c index d1c51b01..1a67bac9 100644 --- a/src/common/helper.c +++ b/src/common/helper.c | |||
@@ -56,6 +56,8 @@ static GtkWidget * infoWindow; | |||
56 | 56 | ||
57 | static GtkWidget * infoWindowTextView; | 57 | static GtkWidget * infoWindowTextView; |
58 | 58 | ||
59 | static GdkWindowState main_window_state; | ||
60 | |||
59 | /** | 61 | /** |
60 | * the main thread | 62 | * the main thread |
61 | */ | 63 | */ |
@@ -598,5 +600,23 @@ char * validate_utf8(char * msg) { | |||
598 | return msg; | 600 | return msg; |
599 | } | 601 | } |
600 | 602 | ||
603 | /** | ||
604 | * Gtk callback to save the main window state (tray icon use) | ||
605 | */ | ||
606 | void saveMainWindowState(GtkWidget *main_window, | ||
607 | GdkEventWindowState *event, | ||
608 | gpointer user_data) | ||
609 | { | ||
610 | main_window_state = (*event).new_window_state; | ||
611 | return; | ||
612 | } | ||
613 | |||
614 | /** | ||
615 | * Get the last main window state when restoring (tray icon use) | ||
616 | */ | ||
617 | GdkWindowState getMainWindowState() | ||
618 | { | ||
619 | return main_window_state; | ||
620 | } | ||
601 | 621 | ||
602 | /* end of helper.c */ | 622 | /* end of helper.c */ |
diff --git a/src/core/eggtrayicon.c b/src/core/eggtrayicon.c index f3872d17..f16bc9ed 100644 --- a/src/core/eggtrayicon.c +++ b/src/core/eggtrayicon.c | |||
@@ -599,10 +599,14 @@ static gboolean tray_clicked(GtkWidget *event_box, | |||
599 | root | 599 | root |
600 | = glade_xml_get_widget(getMainXML(), | 600 | = glade_xml_get_widget(getMainXML(), |
601 | "mainWindow"); | 601 | "mainWindow"); |
602 | GdkWindowState main_window_state; | ||
602 | if (gtk_window_is_active (GTK_WINDOW(root))) | 603 | if (gtk_window_is_active (GTK_WINDOW(root))) |
603 | gtk_widget_hide (root); | 604 | gtk_widget_hide (root); |
604 | else | 605 | else |
605 | gtk_window_present (GTK_WINDOW(root)); | 606 | gtk_window_present (GTK_WINDOW(root)); |
607 | main_window_state = getMainWindowState(); | ||
608 | if(main_window_state & GDK_WINDOW_STATE_MAXIMIZED) | ||
609 | gtk_window_maximize (GTK_WINDOW(root)); | ||
606 | return TRUE; | 610 | return TRUE; |
607 | } | 611 | } |
608 | 612 | ||
diff --git a/src/include/gnunetgtk_common.h b/src/include/gnunetgtk_common.h index 5abb24db..2769fc79 100644 --- a/src/include/gnunetgtk_common.h +++ b/src/include/gnunetgtk_common.h | |||
@@ -121,4 +121,17 @@ void gnunetgtk_notify(int type, | |||
121 | */ | 121 | */ |
122 | char * validate_utf8(char * msg); | 122 | char * validate_utf8(char * msg); |
123 | 123 | ||
124 | /** | ||
125 | * Gtk callback to save the main window state (tray icon use) | ||
126 | */ | ||
127 | void saveMainWindowState(GtkWidget *main_window, | ||
128 | GdkEventWindowState *event, | ||
129 | gpointer user_data); | ||
130 | |||
131 | /** | ||
132 | * Get the last main window state when restoring (tray icon use) | ||
133 | */ | ||
134 | GdkWindowState getMainWindowState(); | ||
135 | |||
136 | |||
124 | #endif | 137 | #endif |