packages: xfce4-mount-plugin/xfce4-mount-plugin.spec, xfce4-mount-plugin/xf...
baggins
baggins at pld-linux.org
Thu Mar 3 20:45:43 CET 2011
Author: baggins Date: Thu Mar 3 19:45:43 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 6
- properly position menu under plugin icon
---- Files affected:
packages/xfce4-mount-plugin:
xfce4-mount-plugin.spec (1.21 -> 1.22) , xfce4-mount-plugin-position.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/xfce4-mount-plugin/xfce4-mount-plugin.spec
diff -u packages/xfce4-mount-plugin/xfce4-mount-plugin.spec:1.21 packages/xfce4-mount-plugin/xfce4-mount-plugin.spec:1.22
--- packages/xfce4-mount-plugin/xfce4-mount-plugin.spec:1.21 Tue Mar 1 23:17:01 2011
+++ packages/xfce4-mount-plugin/xfce4-mount-plugin.spec Thu Mar 3 20:45:38 2011
@@ -3,13 +3,14 @@
Summary(pl.UTF-8): Narzędzie do montowania/odmontowywania dla panelu Xfce
Name: xfce4-mount-plugin
Version: 0.5.5
-Release: 5
+Release: 6
License: GPL v2+
Group: X11/Applications
Source0: http://archive.xfce.org/src/panel-plugins/xfce4-mount-plugin/0.5/%{name}-%{version}.tar.bz2
# Source0-md5: 1d237468fe23e4e8c29195d9b99c4c5d
Patch0: %{name}-label-uuid.patch
Patch1: %{name}-ui.patch
+Patch2: %{name}-position.patch
URL: http://goodies.xfce.org/projects/panel-plugins/xfce4-mount-plugin
BuildRequires: autoconf >= 2.63
BuildRequires: automake
@@ -39,6 +40,7 @@
%setup -q
%patch0 -p1
%patch1 -p1
+%patch2 -p1
%build
%{__intltoolize}
@@ -47,8 +49,7 @@
%{__autoconf}
%{__autoheader}
%{__automake}
-%configure \
- --disable-static
+%configure
%{__make}
@@ -85,6 +86,10 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.22 2011/03/03 19:45:38 baggins
+- rel 6
+- properly position menu under plugin icon
+
Revision 1.21 2011/03/01 22:17:01 baggins
- rel 5
- port to libxfce4ui
================================================================
Index: packages/xfce4-mount-plugin/xfce4-mount-plugin-position.patch
diff -u /dev/null packages/xfce4-mount-plugin/xfce4-mount-plugin-position.patch:1.1
--- /dev/null Thu Mar 3 20:45:43 2011
+++ packages/xfce4-mount-plugin/xfce4-mount-plugin-position.patch Thu Mar 3 20:45:38 2011
@@ -0,0 +1,67 @@
+diff -ur xfce4-mount-plugin-0.5.5/panel-plugin/mount-plugin.c xfce4-mount-plugin-0.5.5-position/panel-plugin/mount-plugin.c
+--- xfce4-mount-plugin-0.5.5/panel-plugin/mount-plugin.c 2011-03-03 20:42:54.618752071 +0100
++++ xfce4-mount-plugin-0.5.5-position/panel-plugin/mount-plugin.c 2011-03-03 20:41:59.402752071 +0100
+@@ -357,6 +357,54 @@
+
+ }
+
++static void
++mounter_position_menu (GtkMenu *menu,
++ gint *x,
++ gint *y,
++ gboolean *push_in,
++ t_mounter *mounter)
++{
++ GtkWidget *button;
++ GtkRequisition requisition;
++ GtkOrientation orientation;
++
++ button = mounter->button;
++ orientation = xfce_panel_plugin_get_orientation (mounter->plugin);
++ gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
++ gdk_window_get_origin (GTK_WIDGET (mounter->plugin)->window, x, y);
++
++ switch (orientation)
++ {
++ case GTK_ORIENTATION_HORIZONTAL:
++ if (*y + button->allocation.height + requisition.height > gdk_screen_height ())
++ /* Show menu above */
++ *y -= requisition.height;
++ else
++ /* Show menu below */
++ *y += button->allocation.height;
++
++ if (*x + requisition.width > gdk_screen_width ())
++ /* Adjust horizontal position */
++ *x = gdk_screen_width () - requisition.width;
++ break;
++
++ case GTK_ORIENTATION_VERTICAL:
++ if (*x + button->allocation.width + requisition.width > gdk_screen_width ())
++ /* Show menu on the right */
++ *x -= requisition.width;
++ else
++ /* Show menu on the left */
++ *x += button->allocation.width;
++
++ if (*y + requisition.height > gdk_screen_height ())
++ /* Adjust vertical position */
++ *y = gdk_screen_height () - requisition.height;
++ break;
++
++ default:
++ break;
++ }
++}
+
+ static gboolean
+ on_button_press (GtkWidget *widget, GdkEventButton *event, t_mounter *mounter)
+@@ -366,7 +414,7 @@
+ {
+
+ mounter_refresh (mounter); /* refreshs infos regarding mounts data */
+- gtk_menu_popup (GTK_MENU(mounter->menu), NULL, NULL, NULL, NULL, 0,
++ gtk_menu_popup (GTK_MENU(mounter->menu), NULL, NULL, (GtkMenuPositionFunc)mounter_position_menu, mounter, 0,
+ event->time);
+ return TRUE;
+ }
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/xfce4-mount-plugin/xfce4-mount-plugin.spec?r1=1.21&r2=1.22&f=u
More information about the pld-cvs-commit
mailing list