[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 07/15: action popup and normal popup work only with sleeps
noreply at xfce.org
noreply at xfce.org
Wed Jun 1 22:40:00 CEST 2016
This is an automated email from the git hooks/post-receive script.
schuellerf pushed a commit to branch master
in repository panel-plugins/xfce4-clipman-plugin.
commit f02d28708cf0e691cc7e7c7aed7bf9f7db0e5980
Author: Florian Schüller <florian.schueller at gmail.com>
Date: Wed May 25 23:39:44 2016 +0200
action popup and normal popup work only with sleeps
---
panel-plugin/.gitignore | 1 +
panel-plugin/Makefile.am | 2 +-
panel-plugin/actions.c | 2 +-
panel-plugin/main-status-icon.c | 1 +
panel-plugin/plugin.c | 2 ++
panel-plugin/xfce4-popup-clipman.c | 9 ++++++++-
6 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/.gitignore b/panel-plugin/.gitignore
index abfb626..34f9aeb 100644
--- a/panel-plugin/.gitignore
+++ b/panel-plugin/.gitignore
@@ -6,3 +6,4 @@ xfce4-clipman-plugin.desktop
xfce4-clipman-settings
xfce4-clipman.desktop
xfce4-popup-clipman
+xfce4-popup-clipman-actions
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index cb24801..a5ef3d9 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -49,7 +49,7 @@ xfce4_popup_clipman_LDADD = \
#
xfce4_popup_clipman_actions_SOURCES = \
- xfce4-popup-clipman-actions.c \
+ xfce4-popup-clipman.c \
common.h \
$(NULL)
diff --git a/panel-plugin/actions.c b/panel-plugin/actions.c
index 36f40f4..032bee1 100644
--- a/panel-plugin/actions.c
+++ b/panel-plugin/actions.c
@@ -760,7 +760,7 @@ clipman_actions_match_with_menu (ClipmanActions *actions,
gtk_container_add (GTK_CONTAINER (actions->priv->menu), mi);
gtk_widget_show_all (actions->priv->menu);
- while (usleep(100000) == -1);
+ usleep(100000);
gtk_menu_popup (GTK_MENU (actions->priv->menu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time ());
g_slist_free (entries);
diff --git a/panel-plugin/main-status-icon.c b/panel-plugin/main-status-icon.c
index 218b8db..c51ef00 100644
--- a/panel-plugin/main-status-icon.c
+++ b/panel-plugin/main-status-icon.c
@@ -150,6 +150,7 @@ cb_status_icon_popup_menu (MyPlugin *plugin, guint button, guint activate_time)
}
gtk_menu_set_screen (GTK_MENU (plugin->popup_menu), gtk_status_icon_get_screen (plugin->status_icon));
+ usleep(100000);
gtk_menu_popup (GTK_MENU (plugin->popup_menu), NULL, NULL,
(GtkMenuPositionFunc)gtk_status_icon_position_menu, plugin->status_icon,
0, gtk_get_current_event_time ());
diff --git a/panel-plugin/plugin.c b/panel-plugin/plugin.c
index c3d580a..26b176a 100644
--- a/panel-plugin/plugin.c
+++ b/panel-plugin/plugin.c
@@ -353,6 +353,7 @@ plugin_popup_menu (MyPlugin *plugin)
{
#ifdef PANEL_PLUGIN
gtk_menu_set_screen (GTK_MENU (plugin->menu), gtk_widget_get_screen (plugin->button));
+ usleep(100000);
gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL,
plugin->menu_position_func, plugin,
0, gtk_get_current_event_time ());
@@ -452,6 +453,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (xfconf_channel_get_bool (plugin->channel, "/tweaks/popup-at-pointer", FALSE))
{
+ usleep(100000);
gtk_menu_popup (GTK_MENU (plugin->menu), NULL, NULL, NULL, NULL,
0, gtk_get_current_event_time ());
}
diff --git a/panel-plugin/xfce4-popup-clipman.c b/panel-plugin/xfce4-popup-clipman.c
index 41b2c32..718542a 100644
--- a/panel-plugin/xfce4-popup-clipman.c
+++ b/panel-plugin/xfce4-popup-clipman.c
@@ -70,7 +70,14 @@ main (gint argc, gchar *argv[])
event.xclient.type = ClientMessage;
event.xclient.message_type = XInternAtom (display, "STRING", False);
event.xclient.format = 8;
- g_snprintf (event.xclient.data.b, sizeof (event.xclient.data.b), XFCE_CLIPMAN_MESSAGE);
+ if (!g_ascii_strcasecmp(argv[0], "xfce4-popup-clipman-actions"))
+ {
+ g_snprintf (event.xclient.data.b, sizeof (event.xclient.data.b), XFCE_CLIPMAN_ACTION_MESSAGE);
+ }
+ else
+ {
+ g_snprintf (event.xclient.data.b, sizeof (event.xclient.data.b), XFCE_CLIPMAN_MESSAGE);
+ }
if (clipman_plugin_check_is_running (win, &id)) {
event.xclient.window = id;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list