rpms/scim/devel scim-1.4.7-menu-pos.patch, NONE, 1.1 scim.spec, 1.124, 1.125

Huang Peng (phuang) fedora-extras-commits at redhat.com
Thu Jul 17 09:00:49 UTC 2008


Author: phuang

Update of /cvs/pkgs/rpms/scim/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12549

Modified Files:
	scim.spec 
Added Files:
	scim-1.4.7-menu-pos.patch 
Log Message:
Fix bug 444711.


scim-1.4.7-menu-pos.patch:

--- NEW FILE scim-1.4.7-menu-pos.patch ---
diff -up scim-1.4.7/extras/panel/scim_panel_gtk.cpp.menu-pos scim-1.4.7/extras/panel/scim_panel_gtk.cpp
--- scim-1.4.7/extras/panel/scim_panel_gtk.cpp.menu-pos	2008-07-17 16:02:08.000000000 +0800
+++ scim-1.4.7/extras/panel/scim_panel_gtk.cpp	2008-07-17 16:50:32.000000000 +0800
@@ -409,6 +409,8 @@ static PangoFontDescription *_default_fo
 static GtkStatusIcon     *_tray_icon                   = 0;
 // static GtkWidget         *_tray_icon_factory_button    = 0;
 // static gulong             _tray_icon_destroy_signal_id = 0;
+static bool              _tray_icon_clicked            = false;
+static guint             _tray_icon_clicked_time       = 0;
 #endif
 
 static gboolean           _input_window_draging        = FALSE;
@@ -1699,12 +1701,16 @@ static void
 ui_tray_icon_popup_menu_cb (GtkStatusIcon *status_icon, guint button, 
     guint activate_time, gpointer user_data)
 {
+    _tray_icon_clicked = true;
+    _tray_icon_clicked_time = activate_time;
     action_show_command_menu ();
 }
 
 static void
 ui_tray_icon_activate_cb (GtkStatusIcon *status_icon, gpointer user_data)
 {
+    _tray_icon_clicked = true;
+    _tray_icon_clicked_time = gtk_get_current_event_time ();
     _panel_agent->request_factory_menu ();
 }
 
@@ -2459,8 +2465,12 @@ action_show_command_menu (void)
                       G_CALLBACK (ui_command_menu_exit_activate_cb),
                       0);
     gtk_widget_show_all (menu_item);
-
-    gtk_menu_popup (GTK_MENU (_command_menu), 0, 0, 0, 0, 2, activate_time);
+    if (_tray_icon_clicked && _tray_icon) {
+        gtk_menu_popup (GTK_MENU (_command_menu), 0, 0, gtk_status_icon_position_menu, _tray_icon, 2, _tray_icon_clicked_time);
+    }
+    else
+        gtk_menu_popup (GTK_MENU (_command_menu), 0, 0, 0, 0, 2, activate_time);
+    _tray_icon_clicked = false;
 }
 
 //////////////////////////////////////////////////////////////////////
@@ -2752,7 +2762,6 @@ slot_show_factory_menu (const std::vecto
         MapStringVectorSizeT groups;
         std::map<String,size_t> langs, recents;
 
-        guint32 activate_time = gtk_get_current_event_time ();
 
         _factory_menu_uuids.clear ();
         _factory_menu_activated = true;
@@ -2847,7 +2856,17 @@ slot_show_factory_menu (const std::vecto
         g_signal_connect (G_OBJECT (_factory_menu), "deactivate",
                           G_CALLBACK (ui_factory_menu_deactivate_cb),
                           NULL);
-        gtk_menu_popup (GTK_MENU (_factory_menu), 0, 0, 0, 0, 1, activate_time);
+        
+        if (_tray_icon_clicked && _tray_icon) {
+            while (gtk_main_iteration_do (FALSE));
+            gtk_menu_popup (GTK_MENU (_factory_menu), 0, 0, gtk_status_icon_position_menu, _tray_icon, 1, _tray_icon_clicked_time);
+        }
+        else {
+            gtk_menu_popup (GTK_MENU (_factory_menu), 0, 0, 0, 0, 1, gtk_get_current_event_time ());
+        }
+
+        _tray_icon_clicked = false;
+        
     }
 }
 


Index: scim.spec
===================================================================
RCS file: /cvs/pkgs/rpms/scim/devel/scim.spec,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- scim.spec	17 Jul 2008 06:06:06 -0000	1.124
+++ scim.spec	17 Jul 2008 08:59:37 -0000	1.125
@@ -3,7 +3,7 @@
 
 Name:      scim
 Version:   1.4.7
-Release:   27%{?dist}
+Release:   28%{?dist}
 Summary:   Smart Common Input Method platform
 
 License:   LGPLv2+
@@ -46,6 +46,7 @@
 Patch24:   scim-1.4.7-translation-update-431995.patch
 Patch25:   scim-1.4.7-timeout.patch
 Patch26:   scim-1.4.7-trayicon.patch
+Patch27:   scim-1.4.7-menu-pos.patch
 
 %description
 SCIM is a user friendly and full featured input method user interface and
@@ -175,6 +176,7 @@
 %patch24 -p1 -b .24-trans
 %patch25 -p1 -b .25-timeout
 %patch26 -p1 -b .26-trayicon
+%patch27 -p1 -b .27-menu-pos
 
 
 %if %{snapshot}
@@ -307,6 +309,9 @@
 
 
 %changelog
+* Thu Jul 17 2008 Huang Peng <phuang at redhat.com> - 1.4.7-28.fc10
+- add patch scim-1.4.7-menu-pos.patch to fix bug 444711.
+
 * Thu Jul 17 2008 Huang Peng <phuang at redhat.com> - 1.4.7-27.fc10
 - add patch scim-1.4.7-timeout.patch to fix bug 444150.
 - add patch scim-1.4.7-trayicon.patch to fix bug 447848.




More information about the scm-commits mailing list