summaryrefslogtreecommitdiffstats
path: root/src/desktop.cpp
diff options
context:
space:
mode:
authorJoel Holdsworth <joel@airwebreathe.org.uk>2007-07-28 12:32:01 +0000
committerjoelholdsworth <joelholdsworth@users.sourceforge.net>2007-07-28 12:32:01 +0000
commit246fcd5198c0a53e27f309777a8ae23e98221753 (patch)
tree22d7909d4ddc490f4cf408afa1a81e6bec601ee2 /src/desktop.cpp
parentFilter effects dialog: (diff)
downloadinkscape-246fcd5198c0a53e27f309777a8ae23e98221753.tar.gz
inkscape-246fcd5198c0a53e27f309777a8ae23e98221753.zip
Gtkmm-ified the desktop window object, and modified the file dialogs so that they are correctly parented
(bzr r3328)
Diffstat (limited to 'src/desktop.cpp')
-rw-r--r--src/desktop.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp
index 859e15bd8..4cfc279cc 100644
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
@@ -1030,9 +1030,9 @@ SPDesktop::setWindowTransient (void *p, int transient_policy)
_widget->setTransient (p, transient_policy);
}
-void SPDesktop::getToplevel( GtkWidget*& toplevel )
+void SPDesktop::getToplevel( Gtk::Widget*& toplevel )
{
- toplevel = GTK_WIDGET( _widget->getWindow() );
+ toplevel = (Gtk::Widget*)_widget->getWindow();
}
void
@@ -1077,6 +1077,35 @@ SPDesktop::shutdown()
return _widget->shutdown();
}
+bool SPDesktop::onDeleteUI (GdkEventAny*)
+{
+ if(shutdown()) return true;
+ destroyWidget();
+ return false;
+}
+
+/**
+ * onWindowStateEvent
+ *
+ * Called when the window changes its maximize/fullscreen/iconify/pinned state.
+ * Since GTK doesn't have a way to query this state information directly, we
+ * record it for the desktop here, and also possibly trigger a layout.
+ */
+bool
+SPDesktop::onWindowStateEvent (GdkEventWindowState* event)
+{
+ // Record the desktop window's state
+ window_state = event->new_window_state;
+
+ // Layout may differ depending on full-screen mode or not
+ GdkWindowState changed = event->changed_mask;
+ if (changed & (GDK_WINDOW_STATE_FULLSCREEN|GDK_WINDOW_STATE_MAXIMIZED)) {
+ layoutWidget();
+ }
+
+ return false;
+}
+
void
SPDesktop::setToolboxFocusTo (gchar const *label)
{