2008-10-06 [colin] 3.6.0cvs8
authorColin Leroy <colin@colino.net>
Mon, 6 Oct 2008 22:36:49 +0000 (22:36 +0000)
committerColin Leroy <colin@colino.net>
Mon, 6 Oct 2008 22:36:49 +0000 (22:36 +0000)
* src/mainwindow.c
* src/mainwindow.h
Handle fullscreen via F11. Patch by
Michael Rasmussen

ChangeLog
PATCHSETS
configure.ac
src/mainwindow.c
src/mainwindow.h

index 1d2cea6..f370745 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-06 [colin]     3.6.0cvs8
+
+       * src/mainwindow.c
+       * src/mainwindow.h
+               Handle fullscreen via F11. Patch by
+               Michael Rasmussen
+
 2008-10-06 [colin]     3.6.0cvs7
 
        * src/common/ssl.c
index fc1d6f0..4a01251 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.274.2.276 -r 1.274.2.277 src/mainwindow.c;  ) > 3.6.0cvs5.patchset
 ( cvs diff -u -r 1.83.2.144 -r 1.83.2.145 src/mimeview.c;  ) > 3.6.0cvs6.patchset
 ( cvs diff -u -r 1.9.2.32 -r 1.9.2.33 src/common/ssl.c;  ) > 3.6.0cvs7.patchset
+( cvs diff -u -r 1.274.2.277 -r 1.274.2.278 src/mainwindow.c;  cvs diff -u -r 1.39.2.51 -r 1.39.2.52 src/mainwindow.h;  ) > 3.6.0cvs8.patchset
index 172cd5d..2b6bac9 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=6
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=7
+EXTRA_VERSION=8
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 554ffa9..f624384 100644 (file)
@@ -1283,6 +1283,19 @@ static gboolean mainwindow_key_pressed (GtkWidget *widget, GdkEventKey *event,
                        }
                }
                break;
+#ifndef MAEMO
+        case GDK_F11:
+                if (mainwin->fullscreen) {
+                    gtk_window_unfullscreen(GTK_WINDOW(mainwin->window));
+                    mainwin->fullscreen = FALSE;
+                }
+                else {
+                    gtk_window_fullscreen(GTK_WINDOW(mainwin->window));
+                    mainwin->fullscreen = TRUE;
+                }
+                break;
+#endif
+
 #ifdef MAEMO
        case GDK_F6:
                if (maemo_mainwindow_is_fullscreen(widget)) {
@@ -2237,6 +2250,8 @@ MainWindow *main_window_create()
 #ifdef MAEMO
        main_window_install_maemo_hooks(mainwin);
 #endif
+        mainwin->fullscreen = FALSE;
+
        return mainwin;
 }
 
@@ -2813,8 +2828,12 @@ void main_window_get_size(MainWindow *mainwin)
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->summaryview)->allocation);
-
-       if (allocation->width > 1 && allocation->height > 1) {
+       
+       if (mainwin->fullscreen) {
+               debug_print("mainwin in full screen state. "
+                           "Keeping original settings\n");
+       }
+       if (allocation->width > 1 && allocation->height > 1 && !mainwin->fullscreen) {
                prefs_common.summaryview_width = allocation->width;
 
                if (messageview_is_visible(mainwin->messageview))
@@ -2825,20 +2844,22 @@ void main_window_get_size(MainWindow *mainwin)
 
        allocation = &mainwin->window->allocation;
        if (allocation->width > 1 && allocation->height > 1 &&
-           !prefs_common.mainwin_maximised) {
+           !prefs_common.mainwin_maximised && !mainwin->fullscreen) {
                prefs_common.mainview_height = allocation->height;
                prefs_common.mainwin_width   = allocation->width;
                prefs_common.mainwin_height  = allocation->height;
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->folderview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1) {
+       if (allocation->width > 1 && allocation->height > 1 &&
+           !mainwin->fullscreen) {
                prefs_common.folderview_width  = allocation->width;
                prefs_common.folderview_height = allocation->height;
        }
 
        allocation = &(GTK_WIDGET_PTR(mainwin->messageview)->allocation);
-       if (allocation->width > 1 && allocation->height > 1) {
+       if (allocation->width > 1 && allocation->height > 1 &&
+           !mainwin->fullscreen) {
                prefs_common.msgview_width = allocation->width;
                prefs_common.msgview_height = allocation->height;
        }
@@ -2858,7 +2879,7 @@ void main_window_get_position(MainWindow *mainwin)
 {
        gint x, y;
 
-       if (prefs_common.mainwin_maximised)
+       if (prefs_common.mainwin_maximised || mainwin->fullscreen)
                return;
 
        gtkut_widget_get_uposition(mainwin->window, &x, &y);
index fb6abb6..095cc54 100644 (file)
@@ -142,7 +142,8 @@ struct _MainWindow
        gboolean         in_folder;
        GtkActionGroup  *action_group;
        GtkUIManager    *ui_manager;
-       
+
+        gboolean        fullscreen;
 };
 
 MainWindow *main_window_create         (void);