diff options
author | Moon <moon@140774ce-b5e7-0310-ab8b-a85725594a96> | 2006-05-30 19:27:32 +0000 |
---|---|---|
committer | Moon <moon@140774ce-b5e7-0310-ab8b-a85725594a96> | 2006-05-30 19:27:32 +0000 |
commit | bf8ddf8b52949ae2ad18164bd5c53c500e5e18a9 (patch) | |
tree | e8e4d180a81a9084975a029b29478be055bb4676 /src | |
parent | e59244a68c8b92e9f60277b3d9fbbd34fdd11374 (diff) | |
download | gnunet-gtk-bf8ddf8b52949ae2ad18164bd5c53c500e5e18a9.tar.gz gnunet-gtk-bf8ddf8b52949ae2ad18164bd5c53c500e5e18a9.zip |
maximizing when restoring from tray icon fixed
nicer 'Advanced' panel icon, not to afraid the users
Diffstat (limited to 'src')
-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 |
3 files changed, 39 insertions, 2 deletions
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 |