[Xfce4-commits] [xfce/xfce4-panel] 08/12: Fix compilation and indentation
noreply at xfce.org
noreply at xfce.org
Mon Feb 27 22:51:49 CET 2017
This is an automated email from the git hooks/post-receive script.
ochosi pushed a commit to branch master
in repository xfce/xfce4-panel.
commit 391353af16b03fc0a9a7f52d3edd04fdb33e2d27
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Mon Feb 27 21:00:50 2017 +0100
Fix compilation and indentation
Also add the textcellrenderer to the combobox in
settings and replace exo with native glib.
---
panel/panel-preferences-dialog.glade | 6 +++
panel/panel-window.c | 101 ++++++++++++++++++-----------------
2 files changed, 57 insertions(+), 50 deletions(-)
diff --git a/panel/panel-preferences-dialog.glade b/panel/panel-preferences-dialog.glade
index 47e2319..da9896d 100644
--- a/panel/panel-preferences-dialog.glade
+++ b/panel/panel-preferences-dialog.glade
@@ -449,6 +449,12 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="model">autohide-behavior-store</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext5"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
</object>
<packing>
<property name="expand">True</property>
diff --git a/panel/panel-window.c b/panel/panel-window.c
index e3be7de..cffe337 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -155,7 +155,7 @@ static void panel_window_active_window_geometry_changed (WnckWindo
static void panel_window_autohide_queue (PanelWindow *window,
AutohideState new_state);
static void panel_window_set_autohide_behavior (PanelWindow *window,
- gboolean autohide);
+ AutohideBehavior behavior);
static void panel_window_update_autohide_window (PanelWindow *window,
WnckScreen *screen,
WnckWindow *active_window);
@@ -441,7 +441,7 @@ panel_window_class_init (PanelWindowClass *klass)
AUTOHIDE_BEHAVIOR_NEVER,
AUTOHIDE_BEHAVIOR_ALWAYS,
AUTOHIDE_BEHAVIOR_NEVER,
- EXO_PARAM_READWRITE));
+ G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SPAN_MONITORS,
@@ -2450,60 +2450,61 @@ panel_window_set_autohide_behavior (PanelWindow *window,
* yet allows us to transition between "always autohide" and "intelligently
* autohide" without recreating the window */
if (window->autohide_window == NULL)
+ {
+ /* create the window */
+ panel_return_if_fail (window->autohide_window == NULL);
+ popup = g_object_new (PANEL_TYPE_BASE_WINDOW,
+ "type", GTK_WINDOW_TOPLEVEL,
+ "decorated", FALSE,
+ "resizable", TRUE,
+ "type-hint", GDK_WINDOW_TYPE_HINT_DOCK,
+ "gravity", GDK_GRAVITY_STATIC,
+ "name", "XfcePanelWindowHidden",
+ NULL);
+
+ /* move the window offscreen */
+ panel_base_window_move_resize (PANEL_BASE_WINDOW (popup),
+ -9999, -9999, 3, 3);
+
+ /* bind some properties to sync the two windows */
+ for (i = 0; i < G_N_ELEMENTS (properties); i++)
{
- /* create the window */
- panel_return_if_fail (window->autohide_window == NULL);
- popup = g_object_new (PANEL_TYPE_BASE_WINDOW,
- "type", GTK_WINDOW_TOPLEVEL,
- "decorated", FALSE,
- "resizable", TRUE,
- "type-hint", GDK_WINDOW_TYPE_HINT_DOCK,
- "gravity", GDK_GRAVITY_STATIC,
- "name", "XfcePanelWindowHidden",
- NULL);
-
- /* move the window offscreen */
- panel_base_window_move_resize (PANEL_BASE_WINDOW (popup),
- -9999, -9999, 3, 3);
-
- /* bind some properties to sync the two windows */
- for (i = 0; i < G_N_ELEMENTS (properties); i++)
- {
- exo_binding_new (G_OBJECT (window), properties[i],
- G_OBJECT (popup), properties[i]);
- }
-
- /* respond to drag motion */
- gtk_drag_dest_set_track_motion (GTK_WIDGET (window), TRUE);
-
- /* signals for pointer enter/leave events */
- g_signal_connect (G_OBJECT (popup), "enter-notify-event",
- G_CALLBACK (panel_window_autohide_event), window);
- g_signal_connect (G_OBJECT (popup), "leave-notify-event",
- G_CALLBACK (panel_window_autohide_event), window);
-
- /* show/hide the panel on drag events */
- gtk_drag_dest_set (popup, 0, NULL, 0, 0);
- gtk_drag_dest_set_track_motion (popup, TRUE);
- g_signal_connect (G_OBJECT (popup), "drag-motion",
- G_CALLBACK (panel_window_autohide_drag_motion), window);
- g_signal_connect (G_OBJECT (popup), "drag-leave",
- G_CALLBACK (panel_window_autohide_drag_leave), window);
-
- /* show the window */
- window->autohide_window = popup;
- gtk_widget_show (popup);
+ g_object_bind_property (G_OBJECT (window), properties[i],
+ G_OBJECT (popup), properties[i],
+ G_BINDING_DEFAULT);
}
+ /* respond to drag motion */
+ gtk_drag_dest_set_track_motion (GTK_WIDGET (window), TRUE);
+
+ /* signals for pointer enter/leave events */
+ g_signal_connect (G_OBJECT (popup), "enter-notify-event",
+ G_CALLBACK (panel_window_autohide_event), window);
+ g_signal_connect (G_OBJECT (popup), "leave-notify-event",
+ G_CALLBACK (panel_window_autohide_event), window);
+
+ /* show/hide the panel on drag events */
+ gtk_drag_dest_set (popup, 0, NULL, 0, 0);
+ gtk_drag_dest_set_track_motion (popup, TRUE);
+ g_signal_connect (G_OBJECT (popup), "drag-motion",
+ G_CALLBACK (panel_window_autohide_drag_motion), window);
+ g_signal_connect (G_OBJECT (popup), "drag-leave",
+ G_CALLBACK (panel_window_autohide_drag_leave), window);
+
+ /* show the window */
+ window->autohide_window = popup;
+ gtk_widget_show (popup);
+ }
+
if (window->autohide_behavior == AUTOHIDE_BEHAVIOR_ALWAYS)
+ {
+ /* start autohide by hiding the panel straight away */
+ if (window->autohide_state != AUTOHIDE_HIDDEN)
{
- /* start autohide by hiding the panel straight away */
- if (window->autohide_state != AUTOHIDE_HIDDEN)
- {
- panel_window_autohide_queue (window,
- window->autohide_block == 0 ? AUTOHIDE_POPDOWN_SLOW : AUTOHIDE_BLOCKED);
- }
+ panel_window_autohide_queue (window,
+ window->autohide_block == 0 ? AUTOHIDE_POPDOWN_SLOW : AUTOHIDE_BLOCKED);
}
+ }
else if (window->autohide_behavior == AUTOHIDE_BEHAVIOR_INTELLIGENTLY)
{
/* start intelligent autohide by making the panel visible initially */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list