All of lore.kernel.org
 help / color / mirror / Atom feed
* [matchbox-desktop-2][PATCH] Do nothing on delete-event when not STANDALONE
@ 2016-03-22 10:41 Jussi Kukkonen
  2016-03-22 12:13 ` Burton, Ross
  0 siblings, 1 reply; 2+ messages in thread
From: Jussi Kukkonen @ 2016-03-22 10:41 UTC (permalink / raw)
  To: yocto

This prevents an opportunistic alt-F4 from closing the desktop.

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 src/desktop.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/desktop.c b/src/desktop.c
index d4fc2fb..94b4ddf 100644
--- a/src/desktop.c
+++ b/src/desktop.c
@@ -122,6 +122,15 @@ load_items (TakuMenu *menu)
 
 }
 
+#ifndef STANDALONE
+static gboolean
+delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
+  /* prevent default handler from destroying the window */
+  return TRUE;
+}
+#endif
+
 static void
 workarea_changed (int x, int y, int w, int h)
 {
@@ -144,11 +153,11 @@ create_desktop (void)
   gtk_icon_size_register ("taku-icon", 64, 64);
 
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
   gtk_widget_set_name (window, "TakuWindow");
   gtk_window_set_title (GTK_WINDOW (window), _("Desktop"));
 
 #ifndef STANDALONE
+  g_signal_connect (window, "delete-event", G_CALLBACK (delete_event_cb), NULL);
   gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_DESKTOP);
   gtk_window_set_skip_taskbar_hint (GTK_WINDOW (window), TRUE);
 
@@ -156,6 +165,7 @@ create_desktop (void)
   screen_w = gdk_screen_get_width (screen);
   screen_h = gdk_screen_get_height (screen);
 #else
+  g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
   screen_w = 640;
   screen_h = 480;
 #endif
-- 
2.7.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [matchbox-desktop-2][PATCH] Do nothing on delete-event when not STANDALONE
  2016-03-22 10:41 [matchbox-desktop-2][PATCH] Do nothing on delete-event when not STANDALONE Jussi Kukkonen
@ 2016-03-22 12:13 ` Burton, Ross
  0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2016-03-22 12:13 UTC (permalink / raw)
  To: Jussi Kukkonen; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

On 22 March 2016 at 10:41, Jussi Kukkonen <jussi.kukkonen@intel.com> wrote:

> This prevents an opportunistic alt-F4 from closing the desktop.
>

Pushed, thanks

Ross

[-- Attachment #2: Type: text/html, Size: 586 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-22 12:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-22 10:41 [matchbox-desktop-2][PATCH] Do nothing on delete-event when not STANDALONE Jussi Kukkonen
2016-03-22 12:13 ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.