From 6f318affeb4d1c6ff66ccfa492713ad6f5e1e69c Mon Sep 17 00:00:00 2001 From: Javier Date: Mon, 26 Jan 2015 00:51:54 +0100 Subject: add a (possibly not necessary?) workaround for transparency --- libmdock/mdock-item.c | 9 +++++++++ libmdock/mdock-item.h | 2 ++ libmdock/mdock-widget.c | 6 ++++++ libmdock/mdock-widget.h | 2 ++ 4 files changed, 19 insertions(+) (limited to 'libmdock') diff --git a/libmdock/mdock-item.c b/libmdock/mdock-item.c index 5b6e0f9..150af74 100644 --- a/libmdock/mdock-item.c +++ b/libmdock/mdock-item.c @@ -439,6 +439,15 @@ void mdock_item_close_all_windows(MDockItem *self) } } +void mdock_item_update_background(MDockItem *self) +{ + GtkWidget *widget = GTK_WIDGET(self); + GdkWindow *window = gtk_widget_get_window(widget); + g_return_if_fail(window); + gdk_window_set_back_pixmap(window, NULL, TRUE); + gtk_widget_queue_draw(widget); +} + void mdock_item_activate(MDockItem *self) { if (self->priv->windows) { diff --git a/libmdock/mdock-item.h b/libmdock/mdock-item.h index 7379687..739c966 100644 --- a/libmdock/mdock-item.h +++ b/libmdock/mdock-item.h @@ -73,6 +73,8 @@ gboolean mdock_item_has_windows(MDockItem *self); void mdock_item_close_all_windows(MDockItem *self); +void mdock_item_update_background(MDockItem *self); + void mdock_item_activate(MDockItem *self); G_END_DECLS diff --git a/libmdock/mdock-widget.c b/libmdock/mdock-widget.c index b202f8a..74467a3 100644 --- a/libmdock/mdock-widget.c +++ b/libmdock/mdock-widget.c @@ -877,6 +877,12 @@ gint mdock_widget_get_n_items(MDockWidget *self) return g_sequence_get_length(self->priv->items); } +void mdock_widget_update_background(MDockWidget *self) +{ + g_sequence_foreach(self->priv->items, + (GFunc)mdock_item_update_background, NULL); +} + GtkWidget *mdock_widget_new(void) { return GTK_WIDGET(g_object_new(MDOCK_TYPE_WIDGET, NULL)); diff --git a/libmdock/mdock-widget.h b/libmdock/mdock-widget.h index 2c49b04..e3d941f 100644 --- a/libmdock/mdock-widget.h +++ b/libmdock/mdock-widget.h @@ -53,6 +53,8 @@ GType mdock_widget_get_type(void); gint mdock_widget_get_n_items(MDockWidget *widget); +void mdock_widget_update_background(MDockWidget *widget); + GtkWidget *mdock_widget_new(void); GtkWidget *mdock_widget_new_with_settings(GSettings *settings); GtkWidget *mdock_widget_new_with_settings_path(const gchar *path); -- cgit v1.2.3