diff options
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/window.c b/src/window.c index 463d8ad..a4807db 100644 --- a/src/window.c +++ b/src/window.c @@ -45,6 +45,16 @@ configure_event_cb(GtkWindow G_GNUC_UNUSED *window, GdkEventConfigure *event, mq_config_save(config); } +static gboolean +window_state_event_cb(GtkWidget G_GNUC_UNUSED *widget, + GdkEventWindowState *event, MqWindow *window) +{ + window->fullscreen = + event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN; + + return FALSE; +} + static void close_confirm_warn_check_button_toggled_cb(GtkToggleButton *toggle_button, MqWindow *window) @@ -192,10 +202,13 @@ mq_window_new(MqApplication *application, const gchar **uris) G_CALLBACK(is_maximized_cb), window->config); g_signal_connect(window->window, "configure-event", G_CALLBACK(configure_event_cb), window->config); + g_signal_connect(window->window, "window-state-event", + G_CALLBACK(window_state_event_cb), window); g_signal_connect(window->window, "delete-event", G_CALLBACK(delete_event_cb), window); g_signal_connect(window->window, "destroy", G_CALLBACK(destroy_cb), window); + window->fullscreen = FALSE; window->notebook = gtk_notebook_new(); gtk_notebook_set_scrollable(GTK_NOTEBOOK(window->notebook), TRUE); @@ -236,6 +249,16 @@ mq_window_get_application(MqWindow *window) } void +mq_window_toggle_fullscreen(MqWindow *window) +{ + if (!window->fullscreen) { + gtk_window_fullscreen(GTK_WINDOW(window->window)); + } else { + gtk_window_unfullscreen(GTK_WINDOW(window->window)); + } +} + +void mq_window_insert_tab(MqWindow *window, GtkWidget *tab_page, GtkWidget *tab_label, gint position) { |