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/configure.ac.in b/configure.ac.in index f30b013..9529bd2 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -15,7 +15,7 @@ m4_define([xfce4_panel_version_minor], [8]) m4_define([xfce4_panel_version_micro], [0]) m4_define([xfce4_panel_version_nano], []) dnl leave this empty to have no nano version m4_define([xfce4_panel_version_build], [@REVISION@]) -m4_define([xfce4_panel_version_tag], []) +m4_define([xfce4_panel_version_tag], [git]) m4_define([xfce4_panel_version], [xfce4_panel_version_major().xfce4_panel_version_minor().xfce4_panel_version_micro()ifelse(xfce4_panel_version_nano(), [], [], [.xfce4_panel_version_nano()])ifelse(xfce4_panel_version_tag(), [git], [xfce4_panel_version_tag()-xfce4_panel_version_build()], [xfce4_panel_version_tag()])]) dnl ******************************************* diff --git a/docs/manual b/docs/manual --- a/docs/manual +++ b/docs/manual @@ -1 +1 @@ -Subproject commit 3ccdb73f1a542683951b9f545ebbab3245343bf0 +Subproject commit 3ccdb73f1a542683951b9f545ebbab3245343bf0-dirty 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..092417b 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; @@ -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; @@ -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..1da04a2 100644 --- a/panel/panel-base-window.c +++ b/panel/panel-base-window.c @@ -206,6 +206,10 @@ panel_base_window_init (PanelBaseWindow *window) window->priv->borders = PANEL_BORDER_NONE; window->priv->active_timeout_id = 0; + /* 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)); + panel_base_window_composited_changed (GTK_WIDGET (window)); } 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-window.c b/panel/panel-window.c index 12c53d8..f8cd275 100644 --- a/panel/panel-window.c +++ b/panel/panel-window.c @@ -859,6 +859,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 +870,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 +925,7 @@ panel_window_motion_notify_event (GtkWidget *widget, /* update the working area */ panel_window_screen_layout_changed (window->screen, window); - return TRUE; + return retval; } @@ -1330,6 +1347,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 */ @@ -2109,7 +2127,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 +2234,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 +2451,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", diff --git a/panel/panel-window.h b/panel/panel-window.h index efb6072..103ad7d 100644 --- a/panel/panel-window.h +++ b/panel/panel-window.h @@ -35,7 +35,7 @@ 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); 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..143209e 100644 --- a/plugins/tasklist/tasklist-widget.c +++ b/plugins/tasklist/tasklist-widget.c @@ -2558,7 +2558,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/po/ja.po b/po/ja.po index d66357f..781ca25 100644 --- a/po/ja.po +++ b/po/ja.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: xfce4-panel 4.7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-16 17:01+0100\n" -"PO-Revision-Date: 2010-12-29 18:56+0900\n" +"POT-Creation-Date: 2011-01-22 23:11+0900\n" +"PO-Revision-Date: 2011-01-22 23:11+0900\n" "Last-Translator: Masato Hashimoto \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -1207,7 +1207,7 @@ msgstr "フォルダを開く" #: ../plugins/directorymenu/directorymenu.c:780 msgid "Open in Terminal" -msgstr "ターミナルを開く" +msgstr "ターミナルで開く" #: ../plugins/directorymenu/directorymenu.desktop.in.h:1 #: ../plugins/directorymenu/directorymenu-dialog.glade.h:2 diff --git a/po/sv.po b/po/sv.po index 193c0ed..af955a6 100644 --- a/po/sv.po +++ b/po/sv.po @@ -4,27 +4,24 @@ # Joakim Andreasson , 2003-2004. # Alexander Toresson , 2006. # Daniel Nylander , 2008, 2009, 2010. -# +# msgid "" msgstr "" "Project-Id-Version: xfce4-panel 4.7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-16 17:01+0100\n" +"POT-Creation-Date: 2011-01-16 23:09+0000\n" "PO-Revision-Date: 2010-10-17 17:45+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" -"Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: sv\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: ../panel-desktop-handler.desktop.in.h:1 -msgid "" -"Add a new launcher to the panel based on the information of this desktop file" -msgstr "" -"Lägg till en ny programstartare till panelen baserat på informationen i " -"denna skrivbordsfil" +msgid "Add a new launcher to the panel based on the information of this desktop file" +msgstr "Lägg till en ny programstartare till panelen baserat på informationen i denna skrivbordsfil" #: ../panel-desktop-handler.desktop.in.h:2 msgid "Create Launcher on the panel" @@ -45,12 +42,8 @@ msgid "_Read Online" msgstr "_Läs på nätet" #: ../common/panel-utils.c:156 -msgid "" -"You can read the user manual online. This manual may however not exactly " -"match your panel version." -msgstr "" -"Du kan läsa användarhandboken på nätet. Denna handbok kan dock vara för en " -"annan version." +msgid "You can read the user manual online. This manual may however not exactly match your panel version." +msgstr "Du kan läsa användarhandboken på nätet. Denna handbok kan dock vara för en annan version." #: ../common/panel-utils.c:158 msgid "The user manual is not installed on your computer" @@ -196,13 +189,8 @@ msgid "Failed to send D-Bus message" msgstr "Misslyckades med att skicka D-Bus-meddelande" #: ../panel/main.c:405 -msgid "" -"Do you want to start the panel? If you do, make sure you save the session on " -"logout, so the panel is automatically started the next time you login." -msgstr "" -"Vill du starta om panelen? Om du gör det så försäkra dig om att du sparar " -"din session vid utloggning så att panelen startas automatiskt nästa gång du " -"loggar in." +msgid "Do you want to start the panel? If you do, make sure you save the session on logout, so the panel is automatically started the next time you login." +msgstr "Vill du starta om panelen? Om du gör det så försäkra dig om att du sparar din session vid utloggning så att panelen startas automatiskt nästa gång du loggar in." #: ../panel/main.c:408 ../panel/main.c:422 #, c-format @@ -214,12 +202,8 @@ msgid "Failed to launch the migration application" msgstr "Misslyckades med att starta migreringsprogrammet" #: ../panel/panel-application.c:1446 ../plugins/actions/actions.c:413 -msgid "" -"You have started X without session manager. Clicking Quit will close the X " -"server." -msgstr "" -"Du har startat X utan en sessionshanterare. Klicka på Avsluta för att stänga " -"X-servern." +msgid "You have started X without session manager. Clicking Quit will close the X server." +msgstr "Du har startat X utan en sessionshanterare. Klicka på Avsluta för att stänga X-servern." #: ../panel/panel-application.c:1447 ../plugins/actions/actions.c:414 msgid "Are you sure you want to quit the panel?" @@ -231,14 +215,12 @@ msgid "Failed to execute command \"%s\"" msgstr "Kunde inte köra kommandot \"%s\"" #: ../panel/panel-dbus-client.c:209 -msgid "" -"Invalid plugin event syntax specified. Use PLUGIN-NAME:NAME[:TYPE:VALUE]." +msgid "Invalid plugin event syntax specified. Use PLUGIN-NAME:NAME[:TYPE:VALUE]." msgstr "" #: ../panel/panel-dbus-client.c:242 #, c-format -msgid "" -"Invalid hint type \"%s\". Valid types are bool, double, int, string and uint." +msgid "Invalid hint type \"%s\". Valid types are bool, double, int, string and uint." msgstr "" #: ../panel/panel-dialogs.c:76 @@ -269,9 +251,7 @@ msgid "Panel %d" msgstr "Panel %d" #: ../panel/panel-dialogs.c:183 -msgid "" -"Because the panel is running in kiosk mode, you are not allowed to make " -"changes to the panel configuration as a regular user" +msgid "Because the panel is running in kiosk mode, you are not allowed to make changes to the panel configuration as a regular user" msgstr "" #: ../panel/panel-dialogs.c:185 @@ -302,10 +282,7 @@ msgstr "Insticksmodulen \"%s\" lämnade oväntat panelen. Vill du starta om den? #: ../panel/panel-plugin-external.c:422 #, c-format -msgid "" -"The plugin restarted more than once in the last %d seconds. If you press " -"Execute the panel will try to restart the plugin otherwise it will be " -"permanently removed from the panel." +msgid "The plugin restarted more than once in the last %d seconds. If you press Execute the panel will try to restart the plugin otherwise it will be permanently removed from the panel." msgstr "" #: ../panel/panel-preferences-dialog.c:453 @@ -367,14 +344,11 @@ msgid "Add a new panel" msgstr "Lägg till en ny panel" #: ../panel/panel-preferences-dialog.glade.h:3 -#, fuzzy msgid "Add new item to this panel" -msgstr "Lägg till objekt till panelen" +msgstr "Lägg till nytt objekt till denna panel" #: ../panel/panel-preferences-dialog.glade.h:4 -msgid "" -"Alpha value of the panel background, with 0 being fully transparent and 100 " -"fully opaque." +msgid "Alpha value of the panel background, with 0 being fully transparent and 100 fully opaque." msgstr "" #: ../panel/panel-preferences-dialog.glade.h:5 @@ -425,7 +399,8 @@ msgstr "O_bjekt" msgid "L_ength (%):" msgstr "Lä_ngd (%):" -#. I18N: name of the section (frame) in the panel preferences where the user can define the length and size of the panel +#. I18N: name of the section (frame) in the panel preferences where the user +#. can define the length and size of the panel #: ../panel/panel-preferences-dialog.glade.h:18 msgid "Measurements" msgstr "" @@ -459,23 +434,19 @@ msgid "Pick a Panel Color" msgstr "Välj en panelfärg" #: ../panel/panel-preferences-dialog.glade.h:26 -#, fuzzy msgid "Remove currently selected item" -msgstr "Ta bort aktuellt markerad panel" +msgstr "Ta bort markerat objekt" #: ../panel/panel-preferences-dialog.glade.h:27 -#, fuzzy msgid "Remove the currently selected panel" -msgstr "Ta bort aktuellt markerad panel" +msgstr "Ta bort den markerade panelen" #: ../panel/panel-preferences-dialog.glade.h:28 msgid "Select A Background Image" msgstr "Välj en bakgrundsbild" #: ../panel/panel-preferences-dialog.glade.h:29 -msgid "" -"Select this option to automatically increase the length of the panel if the " -"plugins request more space." +msgid "Select this option to automatically increase the length of the panel if the plugins request more space." msgstr "" #: ../panel/panel-preferences-dialog.glade.h:30 @@ -483,14 +454,11 @@ msgid "Select this option to extend the panel over multiple monitors." msgstr "" #: ../panel/panel-preferences-dialog.glade.h:31 -msgid "" -"Select this option to hide the handles of the panel and lock its position." +msgid "Select this option to hide the handles of the panel and lock its position." msgstr "" #: ../panel/panel-preferences-dialog.glade.h:32 -msgid "" -"Select this option to hide the panel when the pointer is not above it. This " -"only works when the panel is attached to a screen edge." +msgid "Select this option to hide the panel when the pointer is not above it. This only works when the panel is attached to a screen edge." msgstr "" #: ../panel/panel-preferences-dialog.glade.h:33 @@ -503,20 +471,15 @@ msgid "Solid color" msgstr "Enfärgad" #: ../panel/panel-preferences-dialog.glade.h:35 -#, fuzzy msgid "Span mo_nitors" -msgstr "Sträck över flera skärmar" +msgstr "Sträck över flera s_kärmar" #: ../panel/panel-preferences-dialog.glade.h:36 -msgid "" -"Transparency when the pointer is hovering over the panel, with 0 being fully " -"transparent and 100 fully opaque." +msgid "Transparency when the pointer is hovering over the panel, with 0 being fully transparent and 100 fully opaque." msgstr "" #: ../panel/panel-preferences-dialog.glade.h:37 -msgid "" -"Transparency when the pointer is not hovering over the panel, with 0 being " -"fully transparent and 100 fully opaque." +msgid "Transparency when the pointer is not hovering over the panel, with 0 being fully transparent and 100 fully opaque." msgstr "" #: ../panel/panel-preferences-dialog.glade.h:38 @@ -587,9 +550,7 @@ msgid "Welcome to the first start of the panel" msgstr "Välkommen till första starten av panelen" #: ../migrate/main.c:80 -msgid "" -"Because the panel moved to a new system for storing the settings, it has to " -"load a fresh initial configuration." +msgid "Because the panel moved to a new system for storing the settings, it has to load a fresh initial configuration." msgstr "" #: ../migrate/main.c:83 @@ -722,9 +683,7 @@ msgid "Select A Menu File" msgstr "Välj en menyfil" #: ../plugins/applicationsmenu/applicationsmenu-dialog.glade.h:8 -msgid "" -"Select this option to show the generic application name in the menu, for " -"example \"File Manager\" instead of \"Thunar\"" +msgid "Select this option to show the generic application name in the menu, for example \"File Manager\" instead of \"Thunar\"" msgstr "" #: ../plugins/applicationsmenu/applicationsmenu-dialog.glade.h:9 @@ -741,12 +700,11 @@ msgstr "Visa ik_oner i meny" #: ../plugins/applicationsmenu/applicationsmenu-dialog.glade.h:12 msgid "Use c_ustom menu file:" -msgstr "" +msgstr "Använd a_npassad menyfil:" #: ../plugins/applicationsmenu/applicationsmenu-dialog.glade.h:13 -#, fuzzy msgid "Use the _default menu" -msgstr "Använd standardkonfiguration" +msgstr "Använd s_tandardmenyn" #: ../plugins/applicationsmenu/applicationsmenu-dialog.glade.h:14 #: ../plugins/directorymenu/directorymenu-dialog.glade.h:9 @@ -779,7 +737,7 @@ msgstr "Misslyckades med att läsa in programmenyn" #: ../plugins/applicationsmenu/applicationsmenu.desktop.in.h:2 msgid "Show a menu containing categories of installed applications" -msgstr "" +msgstr "Visa en meny med kategorier av installerade program" #: ../plugins/applicationsmenu/xfce4-popup-applicationsmenu.sh:27 #: ../plugins/directorymenu/xfce4-popup-directorymenu.sh:27 @@ -856,13 +814,13 @@ msgstr "Visa s_ekunder" msgid "F_ormat:" msgstr "F_ormat:" -#. I18N: the fuzziness the *precision* of the fuzzy clock. Time steps of 5, 15 or parts of the day. +#. I18N: the fuzziness the *precision* of the fuzzy clock. Time steps of 5, 15 +#. or parts of the day. #: ../plugins/clock/clock-dialog.glade.h:11 msgid "F_uzziness:" msgstr "Lu_ddighet:" #: ../plugins/clock/clock-dialog.glade.h:12 -#, fuzzy msgid "Fl_ash time separators" msgstr "B_linka med tidsavgränsare" @@ -885,7 +843,7 @@ msgstr "Visa _ram" #: ../plugins/clock/clock-dialog.glade.h:17 msgid "Show _inactive dots" -msgstr "" +msgstr "Visa _inaktiva punkter" #: ../plugins/clock/clock-dialog.glade.h:18 #, fuzzy @@ -894,11 +852,7 @@ msgstr "Visa _handtag" #: ../plugins/clock/clock-dialog.glade.h:20 #, no-c-format -msgid "" -"The format describes the date and time parts to insert into the file name. " -"For example, %Y will be substituted with the year, %m with the month and %d " -"with the day. See the documentation of the date utility for additional " -"information." +msgid "The format describes the date and time parts to insert into the file name. For example, %Y will be substituted with the year, %m with the month and %d with the day. See the documentation of the date utility for additional information." msgstr "" #: ../plugins/clock/clock-dialog.glade.h:21 @@ -1161,9 +1115,9 @@ msgid "No default application found for \"%s\"" msgstr "Inget standardprogram hittades för \"%s\"" #: ../plugins/directorymenu/directorymenu.c:605 -#, fuzzy, c-format +#, c-format msgid "Failed to launch default application for \"%s\"" -msgstr "Kunde inte starta \"%s\"" +msgstr "Kunde inte starta standardprogrammet för \"%s\"" #: ../plugins/directorymenu/directorymenu.c:696 #, c-format @@ -1185,13 +1139,10 @@ msgstr "Katalogmeny" #: ../plugins/directorymenu/directorymenu.desktop.in.h:2 msgid "Show a directory tree in a menu" -msgstr "" +msgstr "Visa ett katalogträd i en meny" #: ../plugins/directorymenu/directorymenu-dialog.glade.h:3 -msgid "" -"Enter a list of patterns that will be used to determine which files are " -"visible in a directory. If you specify more than one pattern here, the list " -"items must be separated with semicolons (e.g. *.txt;*.doc)." +msgid "Enter a list of patterns that will be used to determine which files are visible in a directory. If you specify more than one pattern here, the list items must be separated with semicolons (e.g. *.txt;*.doc)." msgstr "" #: ../plugins/directorymenu/directorymenu-dialog.glade.h:4 @@ -1210,7 +1161,7 @@ msgstr "Visa _dolda filer" #: ../plugins/directorymenu/directorymenu-dialog.glade.h:7 msgid "_Base Directory:" -msgstr "" +msgstr "_Baskatalog:" #: ../plugins/directorymenu/directorymenu-dialog.glade.h:8 msgid "_File Pattern:" @@ -1226,7 +1177,7 @@ msgstr "Inga objekt" #: ../plugins/launcher/launcher-dialog.c:740 msgid "If you delete an item, it will be permanently removed" -msgstr "" +msgstr "Om du tar bort ett objekt så går det inte att ångra." #: ../plugins/launcher/launcher-dialog.c:741 #, c-format @@ -1285,9 +1236,7 @@ msgid "North" msgstr "Nord" #: ../plugins/launcher/launcher-dialog.glade.h:16 -msgid "" -"Select this option to disable the tooltips when moving over the panel button " -"or menu items." +msgid "Select this option to disable the tooltips when moving over the panel button or menu items." msgstr "" #: ../plugins/launcher/launcher-dialog.glade.h:17 @@ -1295,13 +1244,12 @@ msgid "Select this option to move the clicked menu item to the panel." msgstr "" #: ../plugins/launcher/launcher-dialog.glade.h:18 -#, fuzzy msgid "Show _label instead of icon" -msgstr "Visa _programikoner" +msgstr "Visa _etikett istället för ikon" #: ../plugins/launcher/launcher-dialog.glade.h:19 msgid "Show last _used item in panel" -msgstr "" +msgstr "Visa senast a_nvända objekt i panelen" #: ../plugins/launcher/launcher-dialog.glade.h:20 msgid "South" @@ -1312,23 +1260,20 @@ msgid "West" msgstr "Väst" #: ../plugins/launcher/launcher-dialog.glade.h:22 -#, fuzzy msgid "_Arrow button position:" -msgstr "_Pilknapp" +msgstr "Position för _pilknapp:" #: ../plugins/launcher/launcher.desktop.in.h:2 msgid "Program launcher with optional menu" msgstr "Programstartare med meny som tillval" #: ../plugins/pager/pager.c:354 ../plugins/pager/pager-dialog.glade.h:8 -#, fuzzy msgid "Workspace _Settings..." -msgstr "Arbetsyteväxlare" +msgstr "Inställningar för a_rbetsyta..." #: ../plugins/pager/pager.c:429 -#, fuzzy msgid "Unable to open the workspace settings" -msgstr "Misslyckades med att öppna dokumentationsvisaren" +msgstr "Kunde inte öppna inställningar för arbetsyta" #: ../plugins/pager/pager-buttons.c:555 ../plugins/windowmenu/windowmenu.c:854 #, c-format @@ -1345,14 +1290,12 @@ msgid "Number of _rows:" msgstr "Antal _rader:" #: ../plugins/pager/pager-dialog.glade.h:4 -msgid "" -"Show a miniature view of the workspace with rectangles for the visible " -"windows" +msgid "Show a miniature view of the workspace with rectangles for the visible windows" msgstr "" #: ../plugins/pager/pager-dialog.glade.h:5 msgid "Show mi_niature view" -msgstr "" +msgstr "Visa mi_niatyrvy" #: ../plugins/pager/pager-dialog.glade.h:6 msgid "Switch workspaces using the mouse _wheel" @@ -1420,9 +1363,7 @@ msgstr "Uppmärksamhetsnotifiering" #. create fake error and show it #: ../plugins/systray/systray.c:850 -msgid "" -"Most likely another widget took over the function of a notification area. " -"This area will be unused." +msgid "Most likely another widget took over the function of a notification area. This area will be unused." msgstr "" # Underlig sträng @@ -1483,11 +1424,11 @@ msgstr "Aldrig" #: ../plugins/tasklist/tasklist-dialog.glade.h:9 msgid "Restore minimized windows to current _workspace" -msgstr "" +msgstr "Återställ minimerade fönster till aktuell _arbetsyta" #: ../plugins/tasklist/tasklist-dialog.glade.h:10 msgid "Ro_tate buttons in vertical panel" -msgstr "" +msgstr "Rote_ra knappen i vertikal panel" #: ../plugins/tasklist/tasklist-dialog.glade.h:11 msgid "Show _flat buttons" @@ -1506,14 +1447,12 @@ msgid "Show only _minimized windows" msgstr "Visa endast _minimerade fönster" #: ../plugins/tasklist/tasklist-dialog.glade.h:15 -#, fuzzy msgid "Show windows from _all workspaces or viewports" -msgstr "Visa fönster från _alla arbetsytor" +msgstr "Visa fönster från _alla arbetsytor eller skrivbordsvyer" #: ../plugins/tasklist/tasklist-dialog.glade.h:16 -#, fuzzy msgid "Show windows from all mo_nitors" -msgstr "Visa fönster från _alla arbetsytor" +msgstr "Visa fönster från a_lla skärmar" #: ../plugins/tasklist/tasklist-dialog.glade.h:17 msgid "Sorting _order:"