[Xfce4-commits] <xfce4-panel:xfce-4.8> Merge branch 'master' into xfce-4.8
Nick Schermer
noreply at xfce.org
Sat Jan 29 21:26:29 CET 2011
Updating branch refs/heads/xfce-4.8
to fe309fcd3e3cdf2ffe533e53bd092e52ff5ed74f (commit)
from 7bdadcf7ea22de838b278d765edd36c6d571e1f9 (commit)
commit fe309fcd3e3cdf2ffe533e53bd092e52ff5ed74f
Merge: 7bdadcf ffb8c17
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jan 29 21:23:07 2011 +0100
Merge branch 'master' into xfce-4.8
commit ffb8c175e9795d0d25d0ce38d8f513285c26e46f
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jan 29 21:12:19 2011 +0100
Unset visible event window in 4.6 plugins.
A lot 4.6 plugins have an event window as plugin child,
but most of them do not disable the visible event window,
resulting in an ugly looking plugin with composited panels.
So detect if the plugin has an event window as child and
hide the visible window.
For this change, plugins need to recompile.
commit 32bc2ef58f0f78d6da4fc498825008f4eba6d9f2
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jan 29 20:40:43 2011 +0100
Properly update the plugin background when moving to other panel.
The background alpha was not send when the other panel was opaque,
leaving a transparent item in opaque panel.
The background was also not unset, so for example the image or
color was not unset.
commit 16ca0888abb9e92ed8a38d1e53128da01c712c4f
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jan 29 18:18:37 2011 +0100
Don't disappear when wm restarts with compositing (bug #7194).
Because of a quick widget hide/show to make sure the
window was redrawn, the window became invisible when quickly
restarting the wm. Remove this unneeded trick.
Also cleanup the colormap handling, we now only set the rgba
colormap in the init function, since it depends on the screen
and won't change during runtime, this makes things a lot easier.
commit f76161d04c3d5e70abb3daf0b4295ed6f219da00
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jan 29 18:08:02 2011 +0100
Remove unneeded check (bug #7149).
commit e3a4cde2b689f7d0bc7abef0024562a78ac9cbaf
Author: Nick Schermer <nick at xfce.org>
Date: Mon Jan 24 20:14:55 2011 +0100
Improve window debug messages.
commit 23fa1aee1651f36c435c4867f09a718948d5c8fe
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 22:26:29 2011 +0100
Don't double expose the panel's child widget (bug #6872).
We chain the expose event to GtkWindow wich on his turn exposes
the container child in GtkContainer. Because we draw (alpha background
and background color) on the window, the child needs to be exposed after
this, so drop the first expose event and only expose the child
in PanelWindow.
commit f3063104180157e7dd029faeccb513ba34c737a4
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 20:37:24 2011 +0100
Deactivate menu button if loading menu failed.
commit 15a5fa2fb459aa175e4b6f98e341bdff0395eccd
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 20:21:52 2011 +0100
Fix autohide direction based on orientation and edge.
When the panel is horizontal and snapped to the left or right
border (not in a corner) is should hide sideways. Same when
a vertical panel is snapped to the top or bottom of the screen.
commit 5f703756fce60eb42396d6e6870abb82172d7e2f
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 18:27:57 2011 +0100
Show launcher add dialog on the same screen as parent.
commit 15e3162d25c26555e23c533848c8c19c50de1bb5
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 18:25:27 2011 +0100
Sync hidden window and panel screen.
commit 4c61574cca5b01984e25c24ab21c8dab9cce7276
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 18:18:00 2011 +0100
Open plugin dialogs on same screen as plugin.
commit c3eac787dc0b962ebde6bf92e304a5e53418082f
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 18:03:58 2011 +0100
Fix dragging a window to another screen.
Only downside it that we have to abort the drag, because the
button is event is gone too.
commit 5d81fb2945bc05e02e413f7f4cbdd39c11cf7133
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 17:33:36 2011 +0100
Remove screen var from panel_application_plugin_insert.
We can get it from the window when we need it.
commit f411e79df2f9255924cd85ff47ad21c1a354cb46
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 17:29:29 2011 +0100
Move the panel menu to the correct screen.
commit 87f60627fdc292007041ee3833ae3c324ab2b1f4
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 17:27:17 2011 +0100
Directly start the panel on the correct screen (bug #7161).
The panel sometimes never made it to the correct screen and
it could even crash on startup, so don't try on the binding
to position the screen, but pass it along when creating the
panel window.
commit 83eed7240c8cb8b4afbc813141b5337fbd3390c5
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 16:20:58 2011 +0100
Remove too new Gtk+ functions.
commit 25f101ce32aaf8eefb06b79bf841ee74375f7d7d
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 14:53:02 2011 +0100
Popup window menu under cursor when on a popup menu.
commit db9f6f5416ada71b070e73347d839aecba925ef0
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 13:39:11 2011 +0100
Again allocate 1x1 requests offscreen in the systray (bug #7143 and #7057).
But with 1 difference; it seems some implementations wait
(like nm-applet) on the size-changed signal. Although this
is a stupid trick, we can easily work around it by allocating
a normal size offscreen; this will trigger the signal and a new
allocation on the tray when the app completed the status icon
setup.
For dead tray icons that are still in the panel, the 1x1 hack
will continue to work since they have no window.
commit 49bc149b475fc5ba6e6e7224437d7b9f0b712337
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 13:07:32 2011 +0100
Don't return a critical on a NULL dbus session.
This way the users gets a normal warning, instead of an abort
when debugging is enabled.
commit 4a3230b22f6cec2549b3ee2ee696b5d8a65ba155
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 12:55:59 2011 +0100
Set and restore a unique role name for windows (bug #7094).
This way each panel window can be identified by window managers
and other tools.
commit 39c02586f4ceefc99c83afdafd15aae0802c847f
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 12:46:23 2011 +0100
Reverse menu item insert order (bug #7102).
The insert order was reversed in 4.8, compared to 4.6.
commit cfad253bd5d09e0fc1e5493e3e621120c9250b9d
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jan 23 12:41:39 2011 +0100
Cache launcher menu tooltip pixbuf (bug #7146).
Because the query-tooltip query in Gtk is not implemented correctly
(although the gtk docs say otherwise), see https://bugzilla.gnome.org/show_bug.cgi?id=516130
we cache the pixbuf, so setting the tooltip will be faster.
commit 09922fc9951c107d915297d3d3874d2293d9cbf4
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jan 22 18:01:32 2011 +0100
Improve systray debugging messages.
Add the pointer location to the icon name, so it is easier
to spot 2 different icons with the same name.
commit ccf4636bb379b8a0d49032fd032b3b29dd1e7528
Author: Nick Schermer <nick at xfce.org>
Date: Sat Jan 22 13:13:59 2011 +0100
Move some systray code around without functionality changes.
- Remove from socket hashtable before telling others the
icon will be removed, this to make sure the window
still exists.
- Move composited detection to socket init, no need to do this
during realize, since we restart the tray on compositing
changes anyway.
commit 2a004cc07a36f9a738b04ff3ca03730f8900e13e
Author: Masato Hashimoto <hashimo at xfce.org>
Date: Sat Jan 22 15:13:49 2011 +0100
l10n: Updated Japanese (ja) translation to 100%
New status: 344 messages complete with 0 fuzzies and 0 untranslated.
Transmitted-via: Transifex (translations.xfce.org).
commit 6485131ab512ab133c9a97411ba83e4ff16aa792
Author: Nick Schermer <nick at xfce.org>
Date: Thu Jan 20 11:09:06 2011 +0100
Migrate monitor information (bug #7135).
commit 8b0c024c435b2cab825ceb2661e2589145e3b5ee
Author: Nick Schermer <nick at xfce.org>
Date: Tue Jan 18 13:10:03 2011 +0100
Fix assert when storing property values in xfconf (bug #7117).
commit e43a35fe1422572a300c7c06e3867a913605ea30
Author: Nick Schermer <nick at xfce.org>
Date: Tue Jan 18 11:31:52 2011 +0100
Make the panels sticky for some window managers (bug #7130).
common/panel-xfconf.c | 21 +++-
libxfce4panel/xfce-panel-macros-46.h | 9 +-
libxfce4panel/xfce-panel-plugin.c | 6 +-
migrate/migrate-46.c | 23 +++-
panel/panel-application.c | 68 +++++++----
panel/panel-base-window.c | 100 ++++++---------
panel/panel-dbus-client.c | 1 -
panel/panel-plugin-external.c | 2 +-
panel/panel-window.c | 175 ++++++++++++++++-----------
panel/panel-window.h | 5 +-
plugins/applicationsmenu/applicationsmenu.c | 2 +
plugins/launcher/launcher-dialog.c | 2 +
plugins/launcher/launcher.c | 22 +++-
plugins/systray/systray-box.c | 14 +-
plugins/systray/systray-manager.c | 12 +--
plugins/systray/systray-socket.c | 41 ++++---
plugins/systray/systray.c | 8 +-
plugins/tasklist/tasklist-widget.c | 4 +-
wrapper/wrapper-plug.c | 4 -
19 files changed, 301 insertions(+), 218 deletions(-)
diff --git a/common/panel-xfconf.c b/common/panel-xfconf.c
index b43809b..451dd18 100644
--- a/common/panel-xfconf.c
+++ b/common/panel-xfconf.c
@@ -36,6 +36,8 @@ panel_properties_store_value (XfconfChannel *channel,
const gchar *object_property)
{
GValue value = { 0, };
+ GdkColor *color;
+ guint16 alpha = 0xffff;
#ifndef NDEBUG
GParamSpec *pspec;
#endif
@@ -53,7 +55,24 @@ panel_properties_store_value (XfconfChannel *channel,
/* write the property to the xfconf channel */
g_value_init (&value, xfconf_property_type);
g_object_get_property (G_OBJECT (object), object_property, &value);
- xfconf_channel_set_property (channel, xfconf_property, &value);
+
+ if (G_LIKELY (xfconf_property_type != GDK_TYPE_COLOR))
+ {
+ xfconf_channel_set_property (channel, xfconf_property, &value);
+ }
+ else
+ {
+ /* work around xfconf's lack of storing colors (bug #7117) and
+ * do the same as xfconf_g_property_bind_gdkcolor() does */
+ color = g_value_get_boxed (&value);
+ xfconf_channel_set_array (channel, xfconf_property,
+ XFCONF_TYPE_UINT16, &color->red,
+ XFCONF_TYPE_UINT16, &color->green,
+ XFCONF_TYPE_UINT16, &color->blue,
+ XFCONF_TYPE_UINT16, &alpha,
+ G_TYPE_INVALID);
+ }
+
g_value_unset (&value);
}
diff --git a/libxfce4panel/xfce-panel-macros-46.h b/libxfce4panel/xfce-panel-macros-46.h
index dd28bb9..ec2d484 100644
--- a/libxfce4panel/xfce-panel-macros-46.h
+++ b/libxfce4panel/xfce-panel-macros-46.h
@@ -420,6 +420,8 @@ G_BEGIN_DECLS
_xpp_realize (XfcePanelPlugin *xpp, \
GtkPlug *plug) \
{ \
+ GtkWidget *ebox; \
+ \
g_return_if_fail (XFCE_IS_PANEL_PLUGIN (xpp)); \
g_return_if_fail (GTK_IS_PLUG (plug)); \
g_return_if_fail (GTK_WIDGET_REALIZED (plug)); \
@@ -435,6 +437,10 @@ G_BEGIN_DECLS
G_CALLBACK (_xpp_provider_signal), plug); \
\
((XfcePanelPluginFunc) construct_func) (xpp); \
+ \
+ ebox = gtk_bin_get_child (GTK_BIN (xpp)); \
+ if (ebox != NULL && GTK_IS_EVENT_BOX (ebox)) \
+ gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE); \
} \
\
static gboolean \
@@ -583,10 +589,7 @@ G_BEGIN_DECLS
gtk_widget_set_app_paintable (plug, TRUE); \
\
screen = gtk_widget_get_screen (plug); \
- \
colormap = gdk_screen_get_rgba_colormap (screen); \
- if (colormap == NULL) \
- colormap = gdk_screen_get_rgb_colormap (screen); \
if (colormap != NULL) \
gtk_widget_set_colormap (plug, colormap); \
\
diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c
index b06885a..360ed7d 100644
--- a/libxfce4panel/xfce-panel-plugin.c
+++ b/libxfce4panel/xfce-panel-plugin.c
@@ -1708,6 +1708,8 @@ xfce_panel_plugin_take_window (XfcePanelPlugin *plugin,
g_return_if_fail (XFCE_IS_PANEL_PLUGIN (plugin));
g_return_if_fail (GTK_IS_WINDOW (window));
+ gtk_window_set_screen (window, gtk_widget_get_screen (GTK_WIDGET (plugin)));
+
/* monitor both objects */
g_object_weak_ref (G_OBJECT (plugin),
xfce_panel_plugin_take_window_notify, window);
@@ -1756,8 +1758,8 @@ xfce_panel_plugin_menu_insert_item (XfcePanelPlugin *plugin,
g_return_if_fail (GTK_IS_MENU_ITEM (item));
/* take the item and add to internal list */
- plugin->priv->menu_items = g_slist_prepend (plugin->priv->menu_items,
- g_object_ref_sink (item));
+ plugin->priv->menu_items = g_slist_append (plugin->priv->menu_items,
+ g_object_ref_sink (item));
g_signal_connect (G_OBJECT (item), "destroy",
G_CALLBACK (xfce_panel_plugin_menu_item_destroy), plugin);
diff --git a/migrate/migrate-46.c b/migrate/migrate-46.c
index 9f3dc27..2f9ebcc 100644
--- a/migrate/migrate-46.c
+++ b/migrate/migrate-46.c
@@ -180,7 +180,10 @@ migrate_46_panel_set_property (ConfigParser *parser,
const gchar *value,
GError **error)
{
- gchar prop[128];
+ gchar prop[128];
+ GdkDisplay *display;
+ gchar *name;
+ gint num;
if (strcmp (property_name, "size") == 0)
{
@@ -200,17 +203,29 @@ migrate_46_panel_set_property (ConfigParser *parser,
}
else if (strcmp (property_name, "xoffset") == 0)
{
- /* TODO test this */
parser->panel_xoffset = MAX (0, atoi (value));
}
else if (strcmp (property_name, "yoffset") == 0)
{
- /* TODO test this */
parser->panel_yoffset = MAX (0, atoi (value));
}
else if (strcmp (property_name, "monitor") == 0)
{
- /* TODO */
+ /* in 4.4 and 4.6 we only use monitor and make no difference between monitors
+ * and screen's, so check the setup of the user to properly convert this */
+ num = MAX (0, atoi (value));
+ if (G_LIKELY (num > 0))
+ {
+ display = gdk_display_get_default ();
+ if (display != NULL && gdk_display_get_n_screens (display) > 1)
+ name = g_strdup_printf ("screen-%d", num);
+ else
+ name = g_strdup_printf ("monitor-%d", num);
+
+ g_snprintf (prop, sizeof (prop), "/panels/panel-%u/output", parser->panel_id_counter);
+ xfconf_channel_set_string (parser->channel, prop, name);
+ g_free (name);
+ }
}
else if (strcmp (property_name, "handlestyle") == 0)
{
diff --git a/panel/panel-application.c b/panel/panel-application.c
index 9431f89..a107f5a 100644
--- a/panel/panel-application.c
+++ b/panel/panel-application.c
@@ -60,7 +60,6 @@ static void panel_application_plugin_move (GtkWidget *i
PanelApplication *application);
static gboolean panel_application_plugin_insert (PanelApplication *application,
PanelWindow *window,
- GdkScreen *screen,
const gchar *name,
gint unique_id,
gchar **arguments,
@@ -260,7 +259,6 @@ panel_application_xfconf_window_bindings (PanelApplication *application,
const PanelProperty properties[] =
{
{ "position-locked", G_TYPE_BOOLEAN },
- { "autohide", G_TYPE_BOOLEAN },
{ "span-monitors", G_TYPE_BOOLEAN },
{ "horizontal", G_TYPE_BOOLEAN },
{ "size", G_TYPE_UINT },
@@ -275,6 +273,8 @@ panel_application_xfconf_window_bindings (PanelApplication *application,
{ "output-name", G_TYPE_STRING },
{ "position", G_TYPE_STRING },
{ "disable-struts", G_TYPE_BOOLEAN },
+ { "role", G_TYPE_STRING }, /* GtkWindow property (see bug #7094) */
+ { "autohide", G_TYPE_BOOLEAN },
{ NULL }
};
@@ -309,17 +309,35 @@ panel_application_load (PanelApplication *application)
GdkScreen *screen;
GPtrArray *array;
const GValue *value;
+ gchar *output_name;
+ gint screen_num;
+ GdkDisplay *display;
panel_return_if_fail (PANEL_IS_APPLICATION (application));
panel_return_if_fail (XFCONF_IS_CHANNEL (application->xfconf));
+ display = gdk_display_get_default ();
+
/* walk all the panel in the configuration */
n_panels = xfconf_channel_get_uint (application->xfconf, "/panels", 0);
for (i = 0; i < n_panels; i++)
{
+ screen = NULL;
+
+ /* start the panel directly on the correct screen */
+ g_snprintf (buf, sizeof (buf), "/panels/panel-%u/output-name", i);
+ output_name = xfconf_channel_get_string (application->xfconf, buf, NULL);
+ if (output_name != NULL
+ && strncmp (output_name, "screen-", 7) == 0
+ && sscanf (output_name, "screen-%d", &screen_num) == 1)
+ {
+ if (screen_num < gdk_display_get_n_screens (display))
+ screen = gdk_display_get_screen (display, screen_num);
+ }
+ g_free (output_name);
+
/* create a new window */
- window = panel_application_new_window (application, NULL, FALSE);
- screen = gtk_window_get_screen (GTK_WINDOW (window));
+ window = panel_application_new_window (application, screen, FALSE);
/* walk all the plugins on the panel */
g_snprintf (buf, sizeof (buf), "/panels/panel-%u/plugin-ids", i);
@@ -341,7 +359,7 @@ panel_application_load (PanelApplication *application)
/* append the plugin to the panel */
if (unique_id < 1 || name == NULL
- || !panel_application_plugin_insert (application, window, screen,
+ || !panel_application_plugin_insert (application, window,
name, unique_id, NULL, -1))
{
/* plugin could not be loaded, remove it from the channel */
@@ -606,7 +624,6 @@ panel_application_plugin_provider_signal (XfcePanelPluginProvider *provide
static gboolean
panel_application_plugin_insert (PanelApplication *application,
PanelWindow *window,
- GdkScreen *screen,
const gchar *name,
gint unique_id,
gchar **arguments,
@@ -617,7 +634,6 @@ panel_application_plugin_insert (PanelApplication *application,
panel_return_val_if_fail (PANEL_IS_APPLICATION (application), FALSE);
panel_return_val_if_fail (PANEL_IS_WINDOW (window), FALSE);
- panel_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
panel_return_val_if_fail (name != NULL, FALSE);
/* leave if the window is locked */
@@ -625,9 +641,9 @@ panel_application_plugin_insert (PanelApplication *application,
return FALSE;
/* create a new panel plugin */
- provider = panel_module_factory_new_plugin (application->factory,
- name, screen, unique_id,
- arguments, &new_unique_id);
+ provider = panel_module_factory_new_plugin (application->factory, name,
+ gtk_window_get_screen (GTK_WINDOW (window)),
+ unique_id, arguments, &new_unique_id);
if (G_UNLIKELY (provider == NULL))
return FALSE;
@@ -653,7 +669,7 @@ panel_application_plugin_insert (PanelApplication *application,
GTK_WIDGET (provider), position);
/* send all the needed info about the panel to the plugin */
- panel_window_set_povider_info (window, provider);
+ panel_window_set_povider_info (window, provider, FALSE);
/* show the plugin */
gtk_widget_show (provider);
@@ -799,7 +815,6 @@ panel_application_drag_data_received (PanelWindow *window,
PanelApplication *application;
GtkWidget *provider;
gboolean succeed = FALSE;
- GdkScreen *screen;
const gchar *name;
guint old_position;
gchar **uris;
@@ -847,9 +862,6 @@ panel_application_drag_data_received (PanelWindow *window,
/* reset the state */
application->drop_occurred = FALSE;
- /* get the widget screen */
- screen = gtk_window_get_screen (GTK_WINDOW (window));
-
switch (info)
{
case TARGET_PLUGIN_NAME:
@@ -857,8 +869,7 @@ panel_application_drag_data_received (PanelWindow *window,
{
/* create a new item with a unique id */
name = (const gchar *) selection_data->data;
- succeed = panel_application_plugin_insert (application, window,
- screen, name,
+ succeed = panel_application_plugin_insert (application, window, name,
-1, NULL, application->drop_index);
}
break;
@@ -896,7 +907,7 @@ panel_application_drag_data_received (PanelWindow *window,
panel_itembar_reorder_child (PANEL_ITEMBAR (itembar), provider, application->drop_index);
/* send all the needed panel information to the plugin */
- panel_window_set_povider_info (window, provider);
+ panel_window_set_povider_info (window, provider, TRUE);
}
/* everything went fine */
@@ -912,8 +923,7 @@ panel_application_drag_data_received (PanelWindow *window,
if (G_LIKELY (uris != NULL))
{
/* create a new item with a unique id */
- succeed = panel_application_plugin_insert (application, window,
- screen, LAUNCHER_PLUGIN_NAME,
+ succeed = panel_application_plugin_insert (application, window, LAUNCHER_PLUGIN_NAME,
-1, uris, application->drop_index);
g_strfreev (uris);
}
@@ -1243,7 +1253,6 @@ panel_application_add_new_item (PanelApplication *application,
/* add the plugin to the end of the choosen window */
window = g_slist_nth_data (application->windows, nth);
panel_application_plugin_insert (application, window,
- gtk_widget_get_screen (GTK_WIDGET (window)),
plugin_name, -1, arguments, -1);
}
else
@@ -1264,21 +1273,20 @@ panel_application_new_window (PanelApplication *application,
GtkWidget *itembar;
gchar *property;
gint idx;
+ GTimeVal tv;
+ gchar *wmrole;
panel_return_val_if_fail (PANEL_IS_APPLICATION (application), NULL);
panel_return_val_if_fail (screen == NULL || GDK_IS_SCREEN (screen), NULL);
panel_return_val_if_fail (XFCONF_IS_CHANNEL (application->xfconf), NULL);
/* create panel window */
- window = panel_window_new ();
+ window = panel_window_new (screen);
/* monitor window destruction */
g_signal_connect (G_OBJECT (window), "destroy",
G_CALLBACK (panel_application_window_destroyed), application);
- /* put on the correct screen */
- gtk_window_set_screen (GTK_WINDOW (window), screen ? screen : gdk_screen_get_default ());
-
/* add the window to internal list */
application->windows = g_slist_append (application->windows, window);
@@ -1325,6 +1333,16 @@ panel_application_new_window (PanelApplication *application,
if (new_window)
g_object_notify (G_OBJECT (window), "position");
+ /* create a somewhat unique role for the panel window (bug #7094) */
+ if (gtk_window_get_role (GTK_WINDOW (window)) == NULL)
+ {
+ g_get_current_time (&tv);
+ idx = g_slist_index (application->windows, window);
+ wmrole = g_strdup_printf (PACKAGE_NAME "-%ld%d", tv.tv_sec, idx);
+ gtk_window_set_role (GTK_WINDOW (window), wmrole);
+ g_free (wmrole);
+ }
+
return PANEL_WINDOW (window);
}
diff --git a/panel/panel-base-window.c b/panel/panel-base-window.c
index 9a0f3fe..751e0c9 100644
--- a/panel/panel-base-window.c
+++ b/panel/panel-base-window.c
@@ -192,6 +192,9 @@ panel_base_window_class_init (PanelBaseWindowClass *klass)
static void
panel_base_window_init (PanelBaseWindow *window)
{
+ GdkColormap *colormap;
+ GdkScreen *screen;
+
window->priv = G_TYPE_INSTANCE_GET_PRIVATE (window, PANEL_TYPE_BASE_WINDOW, PanelBaseWindowPrivate);
window->is_composited = FALSE;
@@ -206,7 +209,23 @@ panel_base_window_init (PanelBaseWindow *window)
window->priv->borders = PANEL_BORDER_NONE;
window->priv->active_timeout_id = 0;
- panel_base_window_composited_changed (GTK_WIDGET (window));
+ /* some wm require stick to show the window on all workspaces, on xfwm4
+ * the type-hint already takes care of that */
+ gtk_window_stick (GTK_WINDOW (window));
+
+ /* set the rgba colormap if supported by the screen */
+ screen = gtk_window_get_screen (GTK_WINDOW (window));
+ colormap = gdk_screen_get_rgba_colormap (screen);
+ if (colormap != NULL)
+ {
+ gtk_widget_set_colormap (GTK_WIDGET (window), colormap);
+ window->is_composited = gtk_widget_is_composited (GTK_WIDGET (window));
+ }
+
+ panel_debug (PANEL_DEBUG_BASE_WINDOW,
+ "%p: rgba colormap=%s, compositing=%s", window,
+ PANEL_DEBUG_BOOL (colormap != NULL),
+ PANEL_DEBUG_BOOL (window->is_composited));
}
@@ -442,19 +461,16 @@ panel_base_window_expose_event (GtkWidget *widget,
gdouble height = widget->allocation.height;
const gdouble dashes[] = { 4.00, 4.00 };
GTimeVal timeval;
- gboolean result;
GdkPixbuf *pixbuf;
GError *error = NULL;
cairo_matrix_t matrix = { 1, 0, 0, 1, 0, 0 }; /* identity matrix */
- result = (*GTK_WIDGET_CLASS (panel_base_window_parent_class)->expose_event) (widget, event);
-
if (!GTK_WIDGET_DRAWABLE (widget))
- return result;
+ return FALSE;
/* create cairo context and set some default properties */
cr = gdk_cairo_create (widget->window);
- panel_return_val_if_fail (cr != NULL, result);
+ panel_return_val_if_fail (cr != NULL, FALSE);
cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
cairo_set_line_width (cr, 1.00);
@@ -595,7 +611,7 @@ panel_base_window_expose_event (GtkWidget *widget,
cairo_destroy (cr);
- return result;
+ return FALSE;
}
@@ -640,50 +656,17 @@ static void
panel_base_window_composited_changed (GtkWidget *widget)
{
PanelBaseWindow *window = PANEL_BASE_WINDOW (widget);
- GdkColormap *colormap = NULL;
gboolean was_composited = window->is_composited;
- gboolean was_visible;
- GdkScreen *screen;
- gboolean colormap_changed;
- gboolean colormap_rgba = FALSE;
-
- panel_return_if_fail (PANEL_IS_BASE_WINDOW (widget));
+ GdkWindow *gdkwindow;
- /* get the widget screen */
- screen = gtk_window_get_screen (GTK_WINDOW (widget));
- panel_return_if_fail (GDK_IS_SCREEN (screen));
-
- /* get the rgba colormap */
- colormap = gdk_screen_get_rgba_colormap (screen);
- if (G_UNLIKELY (colormap == NULL))
- {
- window->is_composited = FALSE;
- colormap = gdk_screen_get_rgb_colormap (screen);
- }
- else
- {
- colormap_rgba = TRUE;
- window->is_composited = gtk_widget_is_composited (widget);
- gtk_window_set_opacity (GTK_WINDOW (widget), window->priv->leave_opacity);
- }
-
- panel_return_if_fail (GDK_IS_COLORMAP (colormap));
- colormap_changed = gtk_widget_get_colormap (widget) != colormap;
+ /* set new compositing state */
+ window->is_composited = gtk_widget_is_composited (widget);
+ if (window->is_composited)
+ gtk_window_set_opacity (GTK_WINDOW (widget), window->priv->leave_opacity);
panel_debug (PANEL_DEBUG_BASE_WINDOW,
- "set new colormap; composited=%s, rgba=%s, visible=%s",
- PANEL_DEBUG_BOOL (gtk_widget_is_composited (widget)),
- PANEL_DEBUG_BOOL (colormap_rgba),
- PANEL_DEBUG_BOOL (GTK_WIDGET_VISIBLE (widget)));
-
- was_visible = GTK_WIDGET_VISIBLE (widget);
- if (was_visible)
- {
- gtk_widget_hide (widget);
-
- if (colormap_changed)
- gtk_widget_unrealize (widget);
- }
+ "%p: compositing=%s", window,
+ PANEL_DEBUG_BOOL (window->is_composited));
/* clear cairo image cache */
if (window->priv->bg_image_cache != NULL)
@@ -692,20 +675,19 @@ panel_base_window_composited_changed (GtkWidget *widget)
window->priv->bg_image_cache = NULL;
}
- if (colormap_changed)
- gtk_widget_set_colormap (widget, colormap);
-
- if (was_visible)
- {
- /* restore the window */
- if (colormap_changed)
- gtk_widget_realize (widget);
- gtk_widget_show (widget);
- }
-
- /* emit the property if it changed */
if (window->is_composited != was_composited)
g_object_notify (G_OBJECT (widget), "composited");
+
+ /* make sure the entire window is redrawn */
+ gdkwindow = gtk_widget_get_window (widget);
+ if (gdkwindow != NULL)
+ gdk_window_invalidate_rect (gdkwindow, NULL, TRUE);
+
+ /* HACK: invalid the geometry, so the wm notices it */
+ gtk_window_move (GTK_WINDOW (window),
+ widget->allocation.x,
+ widget->allocation.y);
+ gtk_widget_queue_resize (widget);
}
diff --git a/panel/panel-dbus-client.c b/panel/panel-dbus-client.c
index 3d34935..47add8b 100644
--- a/panel/panel-dbus-client.c
+++ b/panel/panel-dbus-client.c
@@ -57,7 +57,6 @@ panel_dbus_client_get_proxy (GError **error)
/* return null if no connection is found */
dbus_connection = dbus_g_bus_get (DBUS_BUS_SESSION, error);
- panel_return_val_if_fail (dbus_connection != NULL, NULL);
if (G_UNLIKELY (dbus_connection == NULL))
return NULL;
diff --git a/panel/panel-plugin-external.c b/panel/panel-plugin-external.c
index f4d434a..484b531 100644
--- a/panel/panel-plugin-external.c
+++ b/panel/panel-plugin-external.c
@@ -632,7 +632,7 @@ panel_plugin_external_child_respawn (gpointer user_data)
window = gtk_widget_get_toplevel (GTK_WIDGET (external));
panel_return_val_if_fail (PANEL_IS_WINDOW (window), FALSE);
- panel_window_set_povider_info (PANEL_WINDOW (window), GTK_WIDGET (external));
+ panel_window_set_povider_info (PANEL_WINDOW (window), GTK_WIDGET (external), FALSE);
panel_plugin_external_child_spawn (external);
diff --git a/panel/panel-window.c b/panel/panel-window.c
index 12c53d8..dbdef1e 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -117,7 +117,6 @@ static void panel_window_style_set (GtkWidget *w
static void panel_window_realize (GtkWidget *widget);
static StrutsEgde panel_window_screen_struts_edge (PanelWindow *window);
static void panel_window_screen_struts_set (PanelWindow *window);
-static void panel_window_screen_force_update (PanelWindow *window);
static void panel_window_screen_update_borders (PanelWindow *window);
static SnapPosition panel_window_snap_position (PanelWindow *window);
static void panel_window_display_layout_debug (GtkWidget *widget);
@@ -457,10 +456,6 @@ panel_window_init (PanelWindow *window)
/* set the screen */
panel_window_screen_changed (GTK_WIDGET (window), NULL);
-
- /* watch changes in the compositing */
- g_signal_connect (G_OBJECT (window), "notify::composited",
- G_CALLBACK (panel_window_screen_force_update), NULL);
}
@@ -859,6 +854,8 @@ panel_window_motion_notify_event (GtkWidget *widget,
gint pointer_x, pointer_y;
gint window_x, window_y;
gint high;
+ GdkScreen *screen = NULL;
+ gboolean retval = TRUE;
/* leave when the pointer is not grabbed */
if (G_UNLIKELY (window->grab_time == 0))
@@ -868,12 +865,27 @@ panel_window_motion_notify_event (GtkWidget *widget,
pointer_x = event->x_root;
pointer_y = event->y_root;
+ /* the 0x0 coordinate is a sign the cursor is on another screen then
+ * the panel that is currently dragged */
+ if (event->x == 0 && event->y == 0)
+ {
+ gdk_display_get_pointer (gtk_widget_get_display (widget),
+ &screen, NULL, NULL, NULL);
+ if (screen != gtk_window_get_screen (GTK_WINDOW (window)))
+ {
+ gtk_window_set_screen (GTK_WINDOW (window), screen);
+
+ /* stop the drag, we somehow loose the motion event */
+ window->grab_time = 0;
+ retval = FALSE;
+ }
+ }
/* check if the pointer moved to another monitor */
- if (!window->span_monitors
- && (pointer_x < window->area.x
- || pointer_y < window->area.y
- || pointer_x > window->area.x + window->area.width
- || pointer_y > window->area.y + window->area.height))
+ else if (!window->span_monitors
+ && (pointer_x < window->area.x
+ || pointer_y < window->area.y
+ || pointer_x > window->area.x + window->area.width
+ || pointer_y > window->area.y + window->area.height))
{
/* set base point to cursor position and update working area */
window->base_x = pointer_x;
@@ -908,7 +920,7 @@ panel_window_motion_notify_event (GtkWidget *widget,
/* update the working area */
panel_window_screen_layout_changed (window->screen, window);
- return TRUE;
+ return retval;
}
@@ -1142,10 +1154,33 @@ panel_window_size_allocate (GtkWidget *widget,
/* set hidden window size */
w = h = 3;
- if (window->horizontal)
- w = alloc->width;
- else
- h = alloc->height;
+
+ switch (window->snap_position)
+ {
+ /* left or right of the screen */
+ case SNAP_POSITION_E:
+ case SNAP_POSITION_EC:
+ case SNAP_POSITION_W:
+ case SNAP_POSITION_WC:
+ h = alloc->height;
+ break;
+
+ /* top or bottom of the screen */
+ case SNAP_POSITION_NC:
+ case SNAP_POSITION_SC:
+ case SNAP_POSITION_N:
+ case SNAP_POSITION_S:
+ w = alloc->width;
+ break;
+
+ /* corner or floating panel */
+ default:
+ if (window->horizontal)
+ w = alloc->width;
+ else
+ h = alloc->height;
+ break;
+ }
/* position the autohide window */
panel_window_size_allocate_set_xy (window, w, h, &x, &y);
@@ -1330,6 +1365,7 @@ panel_window_screen_changed (GtkWidget *widget,
{
g_free (window->output_name);
window->output_name = g_strdup_printf ("screen-%d", gdk_screen_get_number (screen));
+ g_object_notify (G_OBJECT (window), "output-name");
}
/* update the screen layout */
@@ -1520,13 +1556,13 @@ panel_window_screen_struts_set (PanelWindow *window)
else if (struts[STRUT_BOTTOM] != 0)
n = STRUT_BOTTOM;
else
- panel_debug (PANEL_DEBUG_STRUTS, "unset");
+ panel_debug (PANEL_DEBUG_STRUTS, "%p: unset", window);
if (n != -1)
{
panel_debug (PANEL_DEBUG_STRUTS,
- "%s=%ld, start_%s=%ld, end_%s=%ld",
- strut_border[n], struts[n],
+ "%p: %s=%ld, start_%s=%ld, end_%s=%ld",
+ window, strut_border[n], struts[n],
strut_xy[n], struts[4 + n * 2],
strut_xy[n], struts[5 + n * 2]);
}
@@ -1536,25 +1572,6 @@ panel_window_screen_struts_set (PanelWindow *window)
static void
-panel_window_screen_force_update (PanelWindow *window)
-{
- panel_return_if_fail (PANEL_IS_WINDOW (window));
-
- if (GTK_WIDGET_VISIBLE (window))
- {
- /* make sure the struts are set again, when enabled */
- if (window->struts_edge != STRUTS_EDGE_NONE
- && window->autohide_state == AUTOHIDE_DISABLED)
- window->struts[0] = -1;
-
- /* update the panel position */
- panel_window_screen_layout_changed (window->screen, window);
- }
-}
-
-
-
-static void
panel_window_screen_update_borders (PanelWindow *window)
{
PanelBorders borders = PANEL_BORDER_NONE;
@@ -1703,7 +1720,7 @@ panel_window_display_layout_debug (GtkWidget *widget)
for (n = 0; n < n_screens; n++)
{
screen = gdk_display_get_screen (display, n);
- g_string_append_printf (str, "screen-%d=[%d,%d] (", n,
+ g_string_append_printf (str, "screen-%d[%p]=[%d,%d] (", n, screen,
gdk_screen_get_width (screen), gdk_screen_get_height (screen));
n_monitors = gdk_screen_get_n_monitors (screen);
@@ -1729,7 +1746,7 @@ panel_window_display_layout_debug (GtkWidget *widget)
}
panel_debug (PANEL_DEBUG_DISPLAY_LAYOUT,
- "display %s: %s",
+ "%p: display=%s, %s", widget,
gdk_display_get_name (display), str->str);
g_string_free (str, TRUE);
@@ -1750,6 +1767,7 @@ panel_window_screen_layout_changed (GdkScreen *screen,
gboolean force_struts_update = FALSE;
gint screen_num;
GdkDisplay *display;
+ GdkScreen *new_screen;
panel_return_if_fail (PANEL_IS_WINDOW (window));
panel_return_if_fail (GDK_IS_SCREEN (screen));
@@ -1775,7 +1793,8 @@ panel_window_screen_layout_changed (GdkScreen *screen,
panel_return_if_fail (n_monitors > 0);
panel_debug (PANEL_DEBUG_POSITIONING,
- "monitors=%d, output-name=%s, span-monitors=%s, base=%d,%d",
+ "%p: screen=%p, monitors=%d, output-name=%s, span-monitors=%s, base=%d,%d",
+ window, screen,
n_monitors, window->output_name,
PANEL_DEBUG_BOOL (window->span_monitors),
window->base_x, window->base_y);
@@ -1803,7 +1822,8 @@ panel_window_screen_layout_changed (GdkScreen *screen,
if (gdk_display_get_n_screens (display) - 1 < screen_num)
{
panel_debug (PANEL_DEBUG_POSITIONING,
- "screen-%d not found, hiding panel", screen_num);
+ "%p: screen-%d not found, hiding panel",
+ window, screen_num);
/* out of range, hide the window */
if (GTK_WIDGET_VISIBLE (window))
@@ -1812,14 +1832,14 @@ panel_window_screen_layout_changed (GdkScreen *screen,
}
else
{
+ new_screen = gdk_display_get_screen (display, screen_num);
panel_debug (PANEL_DEBUG_POSITIONING,
- "moving panel from screen %d to %d",
- gdk_screen_get_number (screen),
- screen_num);
+ "%p: moving window to screen %d[%p] to %d[%p]",
+ window, gdk_screen_get_number (screen), screen,
+ screen_num, new_screen);
/* move window to the correct screen */
- screen = gdk_display_get_screen (display, screen_num);
- gtk_window_set_screen (GTK_WINDOW (window), screen);
+ gtk_window_set_screen (GTK_WINDOW (window), new_screen);
/* we will invoke this function again when the screen
* changes, so bail out */
@@ -1890,8 +1910,8 @@ panel_window_screen_layout_changed (GdkScreen *screen,
if (G_UNLIKELY (monitor_num == -1))
{
panel_debug (PANEL_DEBUG_POSITIONING,
- "output/monitor %s not found, hiding window",
- window->output_name);
+ "%p: monitor %s not found, hiding window",
+ window, window->output_name);
/* hide the panel if the monitor was not found */
if (GTK_WIDGET_VISIBLE (window))
@@ -1943,14 +1963,16 @@ panel_window_screen_layout_changed (GdkScreen *screen,
}
}
- panel_debug (PANEL_DEBUG_POSITIONING,
- "struts edge: %d", window->struts_edge);
+ if (window->struts_edge == STRUTS_EDGE_NONE)
+ panel_debug (PANEL_DEBUG_POSITIONING,
+ "%p: unset struts edge; between monitors", window);
}
/* set the new working area of the panel */
window->area = a;
panel_debug (PANEL_DEBUG_POSITIONING,
- "working-area: x=%d, y=%d, w=%d, h=%d",
+ "%p: working-area: screen=%p, x=%d, y=%d, w=%d, h=%d",
+ window, screen,
a.x, a.y, a.width, a.height);
panel_window_screen_update_borders (window);
@@ -2109,7 +2131,8 @@ panel_window_set_autohide (PanelWindow *window,
guint i;
const gchar *properties[] = { "enter-opacity", "leave-opacity",
"background-alpha", "borders",
- "background-style", "background-color" };
+ "background-style", "background-color",
+ "role", "screen" };
panel_return_if_fail (PANEL_IS_WINDOW (window));
@@ -2215,6 +2238,8 @@ panel_window_menu_popup (PanelWindow *window,
/* create menu */
menu = gtk_menu_new ();
+ gtk_menu_set_screen (GTK_MENU (menu),
+ gtk_window_get_screen (GTK_WINDOW (window)));
g_object_ref_sink (G_OBJECT (menu));
g_signal_connect (G_OBJECT (menu), "deactivate",
G_CALLBACK (panel_window_menu_deactivate), window);
@@ -2430,12 +2455,16 @@ panel_window_set_plugin_screen_position (GtkWidget *widget,
GtkWidget *
-panel_window_new (void)
+panel_window_new (GdkScreen *screen)
{
+ if (screen == NULL)
+ screen = gdk_screen_get_default ();
+
return g_object_new (PANEL_TYPE_WINDOW,
"type", GTK_WINDOW_TOPLEVEL,
"decorated", FALSE,
"resizable", FALSE,
+ "screen", screen,
"type-hint", GDK_WINDOW_TYPE_HINT_DOCK,
"gravity", GDK_GRAVITY_STATIC,
"name", "XfcePanelWindow",
@@ -2446,7 +2475,8 @@ panel_window_new (void)
void
panel_window_set_povider_info (PanelWindow *window,
- GtkWidget *provider)
+ GtkWidget *provider,
+ gboolean moving_to_other_panel)
{
PanelBaseWindow *base_window = PANEL_BASE_WINDOW (window);
@@ -2456,24 +2486,29 @@ panel_window_set_povider_info (PanelWindow *window,
xfce_panel_plugin_provider_set_locked (XFCE_PANEL_PLUGIN_PROVIDER (provider),
panel_window_get_locked (window));
- if (base_window->background_alpha < 1.0)
+ if (PANEL_IS_PLUGIN_EXTERNAL (provider))
{
- if (PANEL_IS_PLUGIN_EXTERNAL (provider))
- panel_plugin_external_set_background_alpha (PANEL_PLUGIN_EXTERNAL (provider),
- base_window->background_alpha);
- }
+ if (moving_to_other_panel || base_window->background_alpha < 1.0)
+ {
+ panel_plugin_external_set_background_alpha (PANEL_PLUGIN_EXTERNAL (provider),
+ base_window->background_alpha);
+ }
- if (base_window->background_style == PANEL_BG_STYLE_COLOR)
- {
- if (PANEL_IS_PLUGIN_EXTERNAL (provider))
- panel_plugin_external_set_background_color (PANEL_PLUGIN_EXTERNAL (provider),
- base_window->background_color);
- }
- else if (base_window->background_style == PANEL_BG_STYLE_IMAGE)
- {
- if (PANEL_IS_PLUGIN_EXTERNAL (provider))
- panel_plugin_external_set_background_image (PANEL_PLUGIN_EXTERNAL (provider),
- base_window->background_image);
+ if (base_window->background_style == PANEL_BG_STYLE_COLOR)
+ {
+ panel_plugin_external_set_background_color (PANEL_PLUGIN_EXTERNAL (provider),
+ base_window->background_color);
+ }
+ else if (base_window->background_style == PANEL_BG_STYLE_IMAGE)
+ {
+ panel_plugin_external_set_background_image (PANEL_PLUGIN_EXTERNAL (provider),
+ base_window->background_image);
+ }
+ else if (moving_to_other_panel)
+ {
+ /* unset the background (PROVIDER_PROP_TYPE_ACTION_BACKGROUND_UNSET) */
+ panel_plugin_external_set_background_color (PANEL_PLUGIN_EXTERNAL (provider), NULL);
+ }
}
panel_window_set_plugin_orientation (provider, window);
diff --git a/panel/panel-window.h b/panel/panel-window.h
index efb6072..99bc252 100644
--- a/panel/panel-window.h
+++ b/panel/panel-window.h
@@ -35,10 +35,11 @@ typedef struct _PanelWindow PanelWindow;
GType panel_window_get_type (void) G_GNUC_CONST;
-GtkWidget *panel_window_new (void) G_GNUC_MALLOC;
+GtkWidget *panel_window_new (GdkScreen *screen) G_GNUC_MALLOC;
void panel_window_set_povider_info (PanelWindow *window,
- GtkWidget *provider);
+ GtkWidget *provider,
+ gboolean moving_to_other_panel);
void panel_window_freeze_autohide (PanelWindow *window);
diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index 8098767..a0fc8af 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -1033,6 +1033,8 @@ applications_menu_plugin_menu (GtkWidget *button,
xfce_dialog_show_error (NULL, error, _("Failed to load the applications menu"));
g_error_free (error);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
+
if (G_LIKELY (menu != NULL))
g_object_unref (G_OBJECT (menu));
diff --git a/plugins/launcher/launcher-dialog.c b/plugins/launcher/launcher-dialog.c
index 80bbc41..7f06aa1 100644
--- a/plugins/launcher/launcher-dialog.c
+++ b/plugins/launcher/launcher-dialog.c
@@ -1125,6 +1125,8 @@ launcher_dialog_show (LauncherPlugin *plugin)
/* setup responses for the add dialog */
object = gtk_builder_get_object (builder, "dialog-add");
+ gtk_window_set_screen (GTK_WINDOW (object),
+ gtk_window_get_screen (GTK_WINDOW (window)));
g_signal_connect (G_OBJECT (object), "response",
G_CALLBACK (launcher_dialog_add_response), dialog);
g_signal_connect (G_OBJECT (object), "delete-event",
diff --git a/plugins/launcher/launcher.c b/plugins/launcher/launcher.c
index fd228cb..c3a5dce 100644
--- a/plugins/launcher/launcher.c
+++ b/plugins/launcher/launcher.c
@@ -2209,18 +2209,26 @@ launcher_plugin_item_query_tooltip (GtkWidget *widget,
gtk_tooltip_set_text (tooltip, name);
}
- /* we use the cached pixbuf for the button, because they are more
- * likely to occur and we don't want to poke the hard drive multiple
- * times for a simple pixbuf. for menu items this is not a big real,
- * so here we use the pixbuf directly */
+ /* the button uses a custom cache because the button widget is never
+ * destroyed, for menu items we cache the pixbuf by attaching the
+ * data on the menu item widget */
if (GTK_IS_MENU_ITEM (widget))
{
- pixbuf = launcher_plugin_tooltip_pixbuf (gtk_widget_get_screen (widget),
- garcon_menu_item_get_icon_name (item));
+ pixbuf = g_object_get_data (G_OBJECT (widget), I_("pixbuf-cache"));
if (G_LIKELY (pixbuf != NULL))
{
gtk_tooltip_set_icon (tooltip, pixbuf);
- g_object_unref (G_OBJECT (pixbuf));
+ }
+ else
+ {
+ pixbuf = launcher_plugin_tooltip_pixbuf (gtk_widget_get_screen (widget),
+ garcon_menu_item_get_icon_name (item));
+ if (G_LIKELY (pixbuf != NULL))
+ {
+ gtk_tooltip_set_icon (tooltip, pixbuf);
+ g_object_set_data_full (G_OBJECT (widget), I_("pixbuf-cache"), pixbuf,
+ (GDestroyNotify) g_object_unref);
+ }
}
}
diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index bf0ebd7..7b9380e 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -40,8 +40,7 @@
#define OFFSCREEN (-9999)
/* some icon implementations request a 1x1 size for invisible icons */
-/*#define REQUISITION_IS_INVISIBLE(child_req) ((child_req).width <= 1 && (child_req).height <= 1)*/
-#define REQUISITION_IS_INVISIBLE(child_req) (FALSE)
+#define REQUISITION_IS_INVISIBLE(child_req) ((child_req).width <= 1 && (child_req).height <= 1)
@@ -442,9 +441,10 @@ systray_box_size_allocate (GtkWidget *widget,
* or the requested size looks like an invisible icons (see macro) */
child_alloc.x = child_alloc.y = OFFSCREEN;
- /* do nothing special with the requested size */
- child_alloc.width = child_req.width;
- child_alloc.height = child_req.height;
+ /* some implementations (hi nm-applet) start their setup on
+ * a size-changed signal, so make sure this event is triggered
+ * by allocation a normal size instead of 1x1 */
+ child_alloc.width = child_alloc.height = row_size;
}
else
{
@@ -554,8 +554,8 @@ systray_box_size_allocate (GtkWidget *widget,
y += row_size * ratio + SPACING;
}
- panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocated %s at (%d,%d;%d,%d)",
- systray_socket_get_name (XFCE_SYSTRAY_SOCKET (child)),
+ panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocated %s[%p] at (%d,%d;%d,%d)",
+ systray_socket_get_name (XFCE_SYSTRAY_SOCKET (child)), child,
child_alloc.x, child_alloc.y, child_alloc.width, child_alloc.height);
gtk_widget_size_allocate (child, &child_alloc);
diff --git a/plugins/systray/systray-manager.c b/plugins/systray/systray-manager.c
index 6a18f9e..d485bfa 100644
--- a/plugins/systray/systray-manager.c
+++ b/plugins/systray/systray-manager.c
@@ -214,8 +214,6 @@ systray_manager_init (SystrayManager *manager)
manager->invisible = NULL;
manager->orientation = GTK_ORIENTATION_HORIZONTAL;
manager->messages = NULL;
-
- /* create new sockets table */
manager->sockets = g_hash_table_new (NULL, NULL);
}
@@ -738,15 +736,13 @@ systray_manager_handle_undock_request (GtkSocket *socket,
panel_return_val_if_fail (XFCE_IS_SYSTRAY_MANAGER (manager), FALSE);
- /* emit signal that the socket will be removed */
- g_signal_emit (manager, systray_manager_signals[ICON_REMOVED], 0, socket);
-
- /* get the xwindow */
- window = systray_socket_get_window (XFCE_SYSTRAY_SOCKET (socket));
-
/* remove the socket from the list */
+ window = systray_socket_get_window (XFCE_SYSTRAY_SOCKET (socket));
g_hash_table_remove (manager->sockets, GUINT_TO_POINTER (*window));
+ /* emit signal that the socket will be removed */
+ g_signal_emit (manager, systray_manager_signals[ICON_REMOVED], 0, socket);
+
/* destroy the socket */
return FALSE;
}
diff --git a/plugins/systray/systray-socket.c b/plugins/systray/systray-socket.c
index 70496b3..52975c9 100644
--- a/plugins/systray/systray-socket.c
+++ b/plugins/systray/systray-socket.c
@@ -122,43 +122,42 @@ static void
systray_socket_realize (GtkWidget *widget)
{
SystraySocket *socket = XFCE_SYSTRAY_SOCKET (widget);
- GdkVisual *visual;
GdkColor transparent = { 0, 0, 0, 0 };
+ GdkWindow *window;
GTK_WIDGET_CLASS (systray_socket_parent_class)->realize (widget);
- visual = gtk_widget_get_visual (widget);
- if (visual->red_prec + visual->blue_prec + visual->green_prec < visual->depth
- && gdk_display_supports_composite (gtk_widget_get_display (widget)))
+ window = gtk_widget_get_window (widget);
+
+ if (socket->is_composited)
{
- gdk_window_set_background (widget->window, &transparent);
- gdk_window_set_composited (widget->window, TRUE);
+ gdk_window_set_background (window, &transparent);
+ gdk_window_set_composited (window, TRUE);
- socket->is_composited = TRUE;
socket->parent_relative_bg = FALSE;
}
- else if (visual == gdk_drawable_get_visual (
- GDK_DRAWABLE (gdk_window_get_parent (widget->window))))
+ else if (gtk_widget_get_visual (widget) ==
+ gdk_drawable_get_visual (GDK_DRAWABLE (gdk_window_get_parent (window))))
{
- gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
+ gdk_window_set_back_pixmap (window, NULL, TRUE);
- socket->is_composited = FALSE;
socket->parent_relative_bg = TRUE;
}
else
{
- socket->is_composited = FALSE;
socket->parent_relative_bg = FALSE;
}
+ gdk_window_set_composited (window, socket->is_composited);
+
gtk_widget_set_app_paintable (widget,
socket->parent_relative_bg || socket->is_composited);
gtk_widget_set_double_buffered (widget, socket->parent_relative_bg);
panel_debug_filtered (PANEL_DEBUG_SYSTRAY,
- "socket %s (composited=%s, relative-bg=%s",
- systray_socket_get_name (socket),
+ "socket %s[%p] (composited=%s, relative-bg=%s",
+ systray_socket_get_name (socket), socket,
PANEL_DEBUG_BOOL (socket->is_composited),
PANEL_DEBUG_BOOL (socket->parent_relative_bg));
}
@@ -197,6 +196,7 @@ systray_socket_size_allocate (GtkWidget *widget,
}
+
static gboolean
systray_socket_expose_event (GtkWidget *widget,
GdkEventExpose *event)
@@ -257,12 +257,13 @@ systray_socket_new (GdkScreen *screen,
result = XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (display),
window, &attr);
- /* leave on an error or is the window does not exist */
+ /* leave on an error or if the window does not exist */
if (gdk_error_trap_pop () != 0 || result == 0)
return NULL;
/* get the windows visual */
visual = gdk_x11_screen_lookup_visual (screen, attr.visual->visualid);
+ panel_return_val_if_fail (visual == NULL || GDK_IS_VISUAL (visual), NULL);
if (G_UNLIKELY (visual == NULL))
return NULL;
@@ -282,13 +283,19 @@ systray_socket_new (GdkScreen *screen,
/* create a new socket */
socket = g_object_new (XFCE_TYPE_SYSTRAY_SOCKET, NULL);
- gtk_widget_set_colormap (GTK_WIDGET (socket), colormap);
socket->window = window;
+ socket->is_composited = FALSE;
+ gtk_widget_set_colormap (GTK_WIDGET (socket), colormap);
/* release the custom colormap */
if (release_colormap)
g_object_unref (G_OBJECT (colormap));
+ /* check if there is an alpha channel in the visual */
+ if (visual->red_prec + visual->blue_prec + visual->green_prec < visual->depth
+ && gdk_display_supports_composite (gdk_screen_get_display (screen)))
+ socket->is_composited = TRUE;
+
return GTK_WIDGET (socket);
}
@@ -396,7 +403,7 @@ systray_socket_get_name_prop (SystraySocket *socket,
const gchar *
-systray_socket_get_name (SystraySocket *socket)
+systray_socket_get_name (SystraySocket *socket)
{
panel_return_val_if_fail (XFCE_IS_SYSTRAY_SOCKET (socket), NULL);
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index cc346e0..74aacec 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -811,8 +811,8 @@ systray_plugin_icon_added (SystrayManager *manager,
gtk_container_add (GTK_CONTAINER (plugin->box), icon);
gtk_widget_show (icon);
- panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "added %s icon",
- systray_socket_get_name (XFCE_SYSTRAY_SOCKET (icon)));
+ panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "added %s[%p] icon",
+ systray_socket_get_name (XFCE_SYSTRAY_SOCKET (icon)), icon);
}
@@ -830,8 +830,8 @@ systray_plugin_icon_removed (SystrayManager *manager,
/* remove the icon from the box */
gtk_container_remove (GTK_CONTAINER (plugin->box), icon);
- panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "removed %s icon",
- systray_socket_get_name (XFCE_SYSTRAY_SOCKET (icon)));
+ panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "removed %s[%p] icon",
+ systray_socket_get_name (XFCE_SYSTRAY_SOCKET (icon)), icon);
}
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index beebd65..19d414a 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -876,8 +876,6 @@ xfce_tasklist_size_layout (XfceTasklist *tasklist,
xfce_tasklist_size_sort_window);
}
- panel_return_if_fail (g_slist_length (windows_scored) == (guint) tasklist->n_windows);
-
if (!tasklist->show_labels)
max_button_length = min_button_length;
else if (tasklist->max_button_length != -1)
@@ -2558,7 +2556,7 @@ xfce_tasklist_button_button_press_event (GtkWidget *button,
gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
- xfce_panel_plugin_position_menu,
+ child->type == CHILD_TYPE_WINDOW ? xfce_panel_plugin_position_menu : NULL,
xfce_tasklist_get_panel_plugin (child->tasklist),
event->button,
event->time);
diff --git a/wrapper/wrapper-plug.c b/wrapper/wrapper-plug.c
index 691c197..99f00c2 100644
--- a/wrapper/wrapper-plug.c
+++ b/wrapper/wrapper-plug.c
@@ -103,11 +103,7 @@ wrapper_plug_init (WrapperPlug *plug)
/* set the colormap */
screen = gtk_window_get_screen (GTK_WINDOW (plug));
-
-
colormap = gdk_screen_get_rgba_colormap (screen);
- if (colormap == NULL)
- colormap = gdk_screen_get_rgb_colormap (screen);
if (colormap != NULL)
gtk_widget_set_colormap (GTK_WIDGET (plug), colormap);
}
More information about the Xfce4-commits
mailing list