[gdl] Add GdlDock:skip-taskbar property.



commit d5731a5b8ffca1981fb52018500e49263cd339bb
Author: Alex Valavanis <a valavanis leeds ac uk>
Date:   Thu Mar 8 10:59:47 2012 +0000

    Add GdlDock:skip-taskbar property.
    
    This prevents a floating dock window from appearing in the system
    taskbar.
    
    Squashed commit of the following:
    
    commit 9fdb0366a584ceceaa88052314ff1d7e981be1f7
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Thu Mar 8 10:56:32 2012 +0000
        Drop single-bit flag and restore skip-taskbar handling
    
    commit e159c116b43e1581f788c5ccc50fa9710193c846
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Thu Mar 8 10:40:03 2012 +0000
        Drop skip-taskbar flag setting from gdl_dock_add_floating_item.  Causing type errors
    
    commit 6e03379508e5be9ba03c77fec6cffc6ba2a40813
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Thu Mar 8 00:06:07 2012 +0000
        validate boolean input for gdl_dock_set_skip_taskbar
    
    commit 9e8f9bc9dd6ada56a964f353ad25a0ff4cdbd421
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Thu Mar 8 00:02:56 2012 +0000
        Make gdl_dock_set_skip_taskbar function public
    
    commit 5ef0813fd96515325cd922d81e4aa294472e800c
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Wed Mar 7 10:50:42 2012 +0000
        Set skip-taskbar in separate function
    
    commit 39446bade06cfc722bf2f8c774d05c90eb989850
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Wed Mar 7 10:33:40 2012 +0000
        Fix indentation
    
    commit 83d954fd4db26cd622d210e51eeea7caaf97c406
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Wed Mar 7 10:25:33 2012 +0000
        Set skip-taskbar in property_set()
    
    commit 1a92771e230caf00ab11e855048e91e131c783dd
    Author: Alex Valavanis <a valavanis leeds ac uk>
    Date:   Tue Mar 6 11:04:38 2012 +0000
        Add GdlDock:skip-taskbar property.

 gdl/gdl-dock.c |   53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 gdl/gdl-dock.h |    3 +++
 2 files changed, 55 insertions(+), 1 deletions(-)
---
diff --git a/gdl/gdl-dock.c b/gdl/gdl-dock.c
index 7a47697..41fb245 100644
--- a/gdl/gdl-dock.c
+++ b/gdl/gdl-dock.c
@@ -129,6 +129,8 @@ struct _GdlDockPrivate
     gint                height;
 
     GtkWidget          *area_window;
+
+    gboolean            skip_taskbar;
 };
 
 enum {
@@ -143,7 +145,8 @@ enum {
     PROP_WIDTH,
     PROP_HEIGHT,
     PROP_FLOAT_X,
-    PROP_FLOAT_Y
+    PROP_FLOAT_Y,
+    PROP_SKIP_TASKBAR
 };
 
 static guint dock_signals [LAST_SIGNAL] = { 0 };
@@ -222,6 +225,25 @@ gdl_dock_class_init (GdlDockClass *klass)
                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
                           GDL_DOCK_PARAM_EXPORT));
 
+    /**
+     * GdlDock:skip-taskbar:
+     *
+     * Whether or not to prevent a floating dock window from appearing in the
+     * taskbar. Note that this only affects floating windows that are created
+     * after this flag is set; existing windows are not affected.  Usually,
+     * this property is used when you create the dock.
+     *
+     * Since: 3.6
+     */
+    g_object_class_install_property (
+        g_object_class, PROP_SKIP_TASKBAR,
+        g_param_spec_boolean ("skip-taskbar",
+                              _("Skip taskbar"),
+                              _("Whether or not to prevent a floating dock window from appearing in the taskbar"),
+                              TRUE,
+                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT |
+                              GDL_DOCK_PARAM_EXPORT));
+
     widget_class->get_preferred_width = gdl_dock_get_preferred_width;
     widget_class->get_preferred_height = gdl_dock_get_preferred_height;
     widget_class->size_allocate = gdl_dock_size_allocate;
@@ -335,6 +357,8 @@ gdl_dock_constructor (GType                  type,
             gtk_window_set_type_hint (GTK_WINDOW (dock->priv->window),
                                       GDK_WINDOW_TYPE_HINT_NORMAL);
 
+            gdl_dock_set_skip_taskbar (dock, dock->priv->skip_taskbar);
+
             /* metacity ignores this */
             gtk_window_move (GTK_WINDOW (dock->priv->window),
                              dock->priv->float_x,
@@ -393,6 +417,9 @@ gdl_dock_set_property  (GObject      *object,
         case PROP_FLOAT_Y:
             dock->priv->float_y = g_value_get_int (value);
             break;
+	case PROP_SKIP_TASKBAR:
+            gdl_dock_set_skip_taskbar (dock, g_value_get_boolean (value));
+	    break;
         default:
             G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
             break;
@@ -448,12 +475,35 @@ gdl_dock_get_property  (GObject      *object,
         case PROP_FLOAT_Y:
             g_value_set_int (value, dock->priv->float_y);
             break;
+        case PROP_SKIP_TASKBAR:
+            g_value_set_boolean (value, dock->priv->skip_taskbar);
+            break;
         default:
             G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
             break;
     }
 }
 
+/**
+ * gdl_dock_set_skip_taskbar:
+ * @dock: The dock whose property should be set.
+ * @skip: %TRUE if floating docks should be prevented from appearing in the taskbar
+ *
+ * Sets whether or not a floating dock window should be prevented from
+ * appearing in the system taskbar.
+ *
+ * Since: 3.6
+ */
+void
+gdl_dock_set_skip_taskbar (GdlDock *dock, gboolean skip)
+{
+    dock->priv->skip_taskbar = (skip != FALSE);
+
+    if (dock->priv->window && dock->priv->window) {
+        gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dock->priv->window), dock->priv->skip_taskbar);
+    }
+}
+
 static void
 gdl_dock_set_title (GdlDock *dock)
 {
@@ -1256,6 +1306,7 @@ gdl_dock_add_floating_item (GdlDock        *dock,
                                        "height", height,
                                        "floatx", x,
                                        "floaty", y,
+                                       "skip-taskbar", dock->priv->skip_taskbar,
                                        NULL));
 
     if (gtk_widget_get_visible (GTK_WIDGET (dock))) {
diff --git a/gdl/gdl-dock.h b/gdl/gdl-dock.h
index 348fea7..05ad4ba 100644
--- a/gdl/gdl-dock.h
+++ b/gdl/gdl-dock.h
@@ -95,6 +95,9 @@ void           gdl_dock_show_preview        (GdlDock       *dock,
                                              GdkRectangle  *rect);
 void           gdl_dock_hide_preview        (GdlDock       *dock);
 
+void           gdl_dock_set_skip_taskbar    (GdlDock       *dock,
+                                             gboolean       skip);
+
 G_END_DECLS
 
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]