diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-04-02 15:14:43 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-04-02 15:14:43 +0200 |
| commit | 69d795a61c70c5a3c138fd631f2aab23a530207f (patch) | |
| tree | b702d8965878a14265c04d8f8b75bf0729818b6a | |
| parent | e1b7a76c01f2e676569683dd419ec6cff82462ea (diff) | |
ForceQuitDialog: make sure that the dialog is not deletable by WM
For this to be safe we need also to ignore the delete events (bzr r3740.4.23)
| -rw-r--r-- | decorations/DecorationsForceQuitDialog.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/decorations/DecorationsForceQuitDialog.cpp b/decorations/DecorationsForceQuitDialog.cpp index a24bb5df2..fd5dad523 100644 --- a/decorations/DecorationsForceQuitDialog.cpp +++ b/decorations/DecorationsForceQuitDialog.cpp @@ -108,6 +108,8 @@ GtkWidget* sheet_style_window_new(ForceQuitDialog* main_dialog, Window parent_xi gtk_window_set_type_hint(self, GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_set_decorated(self, FALSE); gtk_window_set_resizable(self, FALSE); + gtk_window_set_urgency_hint(self, TRUE); + gtk_window_set_deletable(self, FALSE); gtk_window_set_title(self, "Force Quit Dialog"); XClassHint parent_class = {nullptr, nullptr}; @@ -180,6 +182,11 @@ GtkWidget* sheet_style_window_new(ForceQuitDialog* main_dialog, Window parent_xi static void sheet_style_window_class_init(SheetStyleWindowClass* klass) { + GTK_WIDGET_CLASS(klass)->delete_event = [] (GtkWidget* self, GdkEventAny*) { + // Don't destroy the window on delete event + return TRUE; + }; + GTK_WIDGET_CLASS(klass)->draw = [] (GtkWidget* self, cairo_t* cr) { GtkAllocation a; gtk_widget_get_allocation(self, &a); |
