Browse Source

Small cleaups in the code.

upstream/xfce4-panel-4.10.1
Nick Schermer 12 years ago
parent
commit
669aa5a5ff
  1. 2
      Panel-preferences.desktop.in.in
  2. 2
      TODO
  3. 6
      libxfce4panel/xfce-panel-macros.h
  4. 8
      panel/main.c
  5. 1
      panel/panel-dbus-service.c
  6. 9
      panel/panel-window.c
  7. 4
      wrapper/Makefile.am
  8. 8
      wrapper/main.c
  9. 19
      wrapper/wrapper-plug.c

2
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;

2
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.

6
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

8
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)

1
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);

9
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));
}
}

4
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 = \

8
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");

19
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);
}

Loading…
Cancel
Save