[Xfce4-commits] <xfce4-panel:devel> * Misc fixes
Nick Schermer
nick at xfce.org
Tue Aug 11 20:22:38 CEST 2009
Updating branch refs/heads/devel
to c3cffeb9235a6abb0c9cbb953474db2d32964067 (commit)
from 45870f05e866d5f720d80a47fc5fa44b11ddde95 (commit)
commit c3cffeb9235a6abb0c9cbb953474db2d32964067
Author: Nick Schermer <nick at xfce.org>
Date: Fri Jul 4 22:15:42 2008 +0200
* Misc fixes
Panel-preferences.desktop.in.in | 2 +-
TODO | 2 +-
libxfce4panel/xfce-panel-macros.h | 6 +++---
panel/main.c | 8 +++++---
panel/panel-dbus-service.c | 1 +
panel/panel-window.c | 9 +++++++++
wrapper/Makefile.am | 4 +---
wrapper/main.c | 8 +++++---
wrapper/wrapper-plug.c | 19 ++++++++++---------
9 files changed, 36 insertions(+), 23 deletions(-)
diff --git a/Panel-preferences.desktop.in.in b/Panel-preferences.desktop.in.in
index bfd33f6..de68a83 100644
--- a/Panel-preferences.desktop.in.in
+++ b/Panel-preferences.desktop.in.in
@@ -1,7 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
-Exec=xfce4-panel -c
+Exec=xfce4-panel -p
Icon=preferences-system
Type=Application
Categories=X-XFCE;Settings;DesktopSettings;
diff --git a/TODO b/TODO
index 7b41e71..1368157 100644
--- a/TODO
+++ b/TODO
@@ -14,7 +14,7 @@ Libxfce4panel
Panel
-----
- Stack panels on screen edges.
- - Make struts applicaion wide, we can set one strut for
+ - Make struts application wide, we can set one strut for
each screen.
- Support for remote plugins.
diff --git a/libxfce4panel/xfce-panel-macros.h b/libxfce4panel/xfce-panel-macros.h
index 02a9203..7e9000d 100644
--- a/libxfce4panel/xfce-panel-macros.h
+++ b/libxfce4panel/xfce-panel-macros.h
@@ -58,9 +58,9 @@ G_BEGIN_DECLS
#ifndef XFCE_DISABLE_DEPRECATED
/* convenience functions (deprecated) */
-#define xfce_create_panel_button() xfce_panel_create_button()
-#define xfce_create_panel_toggle_button() xfce_panel_create_toggle_button()
-#define xfce_allow_panel_customization() xfce_panel_allow_customization()
+#define xfce_create_panel_button xfce_panel_create_button
+#define xfce_create_panel_toggle_button xfce_panel_create_toggle_button
+#define xfce_allow_panel_customization xfce_panel_allow_customization
/* register definitions (deprecated) */
#define XFCE_PANEL_PLUGIN_REGISTER_INTERNAL XFCE_PANEL_PLUGIN_REGISTER
diff --git a/panel/main.c b/panel/main.c
index 64636b8..2769bfc 100644
--- a/panel/main.c
+++ b/panel/main.c
@@ -49,7 +49,7 @@ static gchar **opt_arguments = NULL;
/* command line options */
-static const GOptionEntry option_entries[] =
+static GOptionEntry option_entries[] =
{
{ "preferences", 'p', 0, G_OPTION_ARG_NONE, &opt_preferences, N_("Show the 'Panel Preferences' dialog"), NULL },
{ "add-items", 'a', 0, G_OPTION_ARG_NONE, &opt_add_items, N_("Show the 'Add New Items' dialog"), NULL },
@@ -77,15 +77,17 @@ main (gint argc, gchar **argv)
/* set translation domain */
xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+#ifndef NDEBUG
/* terminate the program on warnings and critical messages */
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
+#endif
/* initialize the gthread system */
- if (!g_thread_supported ())
+ if (g_thread_supported () == FALSE)
g_thread_init (NULL);
/* initialize gtk+ */
- if (!gtk_init_with_args (&argc, &argv, _("[ARGUMENTS...]"), (GOptionEntry *) option_entries, GETTEXT_PACKAGE, &error))
+ if (!gtk_init_with_args (&argc, &argv, _("[ARGUMENTS...]"), option_entries, GETTEXT_PACKAGE, &error))
{
/* print an error message */
if (error == NULL)
diff --git a/panel/panel-dbus-service.c b/panel/panel-dbus-service.c
index 5325f85..7d655f8 100644
--- a/panel/panel-dbus-service.c
+++ b/panel/panel-dbus-service.c
@@ -131,6 +131,7 @@ panel_dbus_service_display_preferences_dialog (PanelDBusService *service,
panel_return_val_if_fail (error == NULL || *error == NULL, FALSE);
/* TODO: open/move the dialog to the correct screen */
+ g_message ("open on screen %s", display);
/* show the prefernces dialog */
panel_preferences_dialog_show (NULL);
diff --git a/panel/panel-window.c b/panel/panel-window.c
index 998da80..7797903 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -1301,6 +1301,8 @@ panel_window_working_area (PanelWindow *window,
/* get the root monitor geometry */
gdk_screen_get_monitor_geometry (screen, monitor_num, dest);
+ g_message ("%d screens and %d monitors found", gdk_display_get_n_screens (gdk_display_get_default ()), gdk_screen_get_n_monitors (screen));
+
if (window->span_monitors)
{
/* get the number of monitors */
@@ -1318,6 +1320,8 @@ panel_window_working_area (PanelWindow *window,
/* get the monitor geometry */
gdk_screen_get_monitor_geometry (screen, i, &geometry);
+ g_message ("monitor %d, x=%d, y=%d, w=%d, h=%d", i, geometry.x, geometry.y, geometry.width, geometry.height);
+
/* try to extend the dest geometry from the root coordinate's point of view */
if (window->horizontal
&& root_y >= geometry.y
@@ -2181,8 +2185,13 @@ panel_window_set_span_monitors (PanelWindow *window,
if (window->span_monitors != span_monitors)
{
+ /* store new value */
window->span_monitors = !!span_monitors;
+ /* update the working area */
+ panel_window_working_area (window, -1, -1, &window->working_area);
+
+ /* resize the panel */
gtk_widget_queue_resize (GTK_WIDGET (window));
}
}
diff --git a/wrapper/Makefile.am b/wrapper/Makefile.am
index aa0a7b6..7a06536 100644
--- a/wrapper/Makefile.am
+++ b/wrapper/Makefile.am
@@ -8,7 +8,7 @@ INCLUDES = \
-DLIBDIR=\"$(libdir)/xfce4\" \
-DLIBEXECDIR=\"$(libexecdir)/xfce4\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
- -DPACKAGE_LOCALE_DIR=\"$(localedir)\"
+ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
$(PLATFORM_CPPFLAGS)
libexec_PROGRAMS = \
@@ -25,7 +25,6 @@ xfce4_panel_wrapper_CFLAGS = \
$(GTK_CFLAGS) \
$(GMODULE_CFLAGS) \
$(GTHREAD_CFLAGS) \
- $(DBUS_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(PLATFORM_CFLAGS)
@@ -38,7 +37,6 @@ xfce4_panel_wrapper_LDADD = \
$(GTK_LIBS) \
$(GMODULE_LIBS) \
$(GTHREAD_LIBS) \
- $(DBUS_LIBS) \
$(LIBXFCE4UTIL_LIBS)
xfce4_panel_wrapper_DEPENDENCIES = \
diff --git a/wrapper/main.c b/wrapper/main.c
index 19882d6..7147561 100644
--- a/wrapper/main.c
+++ b/wrapper/main.c
@@ -45,7 +45,7 @@ static gchar **opt_arguments = NULL;
-static const GOptionEntry option_entries[] =
+static GOptionEntry option_entries[] =
{
{ "name", 'n', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &opt_name, NULL, NULL },
{ "display-name", 'd', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_STRING, &opt_display_name, NULL, NULL },
@@ -70,15 +70,17 @@ main (gint argc, gchar **argv)
/* set translation domain */
xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+#ifndef NDEBUG
/* terminate the program on warnings and critical messages */
g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
+#endif
/* initialize the gthread system */
- if (!g_thread_supported ())
+ if (g_thread_supported () == FALSE)
g_thread_init (NULL);
/* initialize gtk */
- if (!gtk_init_with_args (&argc, &argv, _("[ARGUMENTS...]"), (GOptionEntry *) option_entries, GETTEXT_PACKAGE, &error))
+ if (!gtk_init_with_args (&argc, &argv, _("[ARGUMENTS...]"), option_entries, GETTEXT_PACKAGE, &error))
{
/* print error */
g_critical ("Failed to initialize GTK+: %s", error ? error->message : "Unable to open display");
diff --git a/wrapper/wrapper-plug.c b/wrapper/wrapper-plug.c
index da2b0e2..a01fc23 100644
--- a/wrapper/wrapper-plug.c
+++ b/wrapper/wrapper-plug.c
@@ -63,7 +63,7 @@ struct _WrapperPlug
/* the panel plugin */
XfcePanelPluginProvider *provider;
-
+
/* socket id of panel window */
GdkNativeWindow socket_id;
@@ -90,7 +90,7 @@ static void
wrapper_plug_class_init (WrapperPlugClass *klass)
{
GtkWidgetClass *gtkwidget_class;
-
+
gtkwidget_class = GTK_WIDGET_CLASS (klass);
gtkwidget_class->client_event = wrapper_plug_client_event;
gtkwidget_class->expose_event = wrapper_plug_expose_event;
@@ -107,7 +107,8 @@ wrapper_plug_init (WrapperPlug *plug)
plug->background_alpha = 1.00;
plug->is_active_panel = FALSE;
plug->is_composited = FALSE;
-
+
+ /* allow painting, else compositing won't work */
gtk_widget_set_app_paintable (GTK_WIDGET (plug), TRUE);
/* connect signal to monitor the compositor changes */
@@ -123,11 +124,11 @@ static gboolean
wrapper_plug_expose_event (GtkWidget *widget,
GdkEventExpose *event)
{
- WrapperPlug *plug = WRAPPER_PLUG (widget);
- cairo_t *cr;
- GdkColor *color;
- GtkStateType state = GTK_STATE_NORMAL;
- gdouble alpha = plug->is_composited ? plug->background_alpha : 1.00;
+ WrapperPlug *plug = WRAPPER_PLUG (widget);
+ cairo_t *cr;
+ GdkColor *color;
+ GtkStateType state = GTK_STATE_NORMAL;
+ gdouble alpha = plug->is_composited ? plug->background_alpha : 1.00;
if (GTK_WIDGET_DRAWABLE (widget) &&
(alpha < 1.00 || plug->is_active_panel))
@@ -159,7 +160,7 @@ wrapper_plug_expose_event (GtkWidget *widget,
cairo_destroy (cr);
}
- return GTK_WIDGET_CLASS(wrapper_plug_parent_class)->expose_event(widget, event);
+ return GTK_WIDGET_CLASS (wrapper_plug_parent_class)->expose_event (widget, event);
}
More information about the Xfce4-commits
mailing list