Browse Source

Send the event time with startup notification instead

of zero, so focus stealing works properly.


(Old svn revision: 29457)
upstream/xfce4-panel-4.10.1
Nick Schermer 14 years ago
parent
commit
a7d77e7282
  1. 2
      NEWS
  2. 20
      plugins/launcher/launcher-exec.c
  3. 6
      plugins/launcher/launcher-exec.h
  4. 12
      plugins/launcher/launcher.c

2
NEWS

@ -2,6 +2,8 @@
======
- Block panel autohide if the widget is grabbed (bug #4597).
- Fix dragging to launcher submenu items (bug #4026).
- Send the event time with startup notification instead
of zero, so focus stealing works properly.
4.5.99.1
========

20
plugins/launcher/launcher-exec.c

@ -92,7 +92,8 @@ static gchar **launcher_exec_parse_argv (LauncherEntry
GError **error) G_GNUC_MALLOC G_GNUC_WARN_UNUSED_RESULT;;
static gboolean launcher_exec_on_screen (GdkScreen *screen,
LauncherEntry *entry,
GSList *list);
GSList *list,
guint32 event_time);
@ -406,7 +407,8 @@ launcher_exec_parse_argv (LauncherEntry *entry,
static gboolean
launcher_exec_on_screen (GdkScreen *screen,
LauncherEntry *entry,
GSList *list)
GSList *list,
guint32 event_time)
{
#ifdef HAVE_LIBSTARTUP_NOTIFICATION
SnLauncherContext *sn_launcher = NULL;
@ -460,7 +462,7 @@ launcher_exec_on_screen (GdkScreen *screen,
if (entry->icon)
sn_launcher_context_set_icon_name (sn_launcher, entry->icon);
sn_launcher_context_initiate (sn_launcher, g_get_prgname (), argv[0], CurrentTime);
sn_launcher_context_initiate (sn_launcher, g_get_prgname (), argv[0], event_time);
/* count environ items */
for (n = 0; listenv[n] != NULL; ++n)
@ -595,7 +597,8 @@ error:
void
launcher_execute (GdkScreen *screen,
LauncherEntry *entry,
GSList *file_list)
GSList *file_list,
guint32 event_time)
{
GSList *li;
GSList fake;
@ -624,13 +627,13 @@ launcher_execute (GdkScreen *screen,
fake.data = li->data;
/* spawn */
proceed = launcher_exec_on_screen (screen, entry, &fake);
proceed = launcher_exec_on_screen (screen, entry, &fake, event_time);
}
}
else
{
/* spawn */
launcher_exec_on_screen (screen, entry, file_list);
launcher_exec_on_screen (screen, entry, file_list, event_time);
}
}
@ -638,7 +641,8 @@ launcher_execute (GdkScreen *screen,
void
launcher_execute_from_clipboard (GdkScreen *screen,
LauncherEntry *entry)
LauncherEntry *entry,
guint32 event_time)
{
GtkClipboard *clipboard;
gchar *text = NULL;
@ -676,7 +680,7 @@ launcher_execute_from_clipboard (GdkScreen *screen,
if (G_LIKELY (filenames))
{
/* run the command with argument from clipboard */
launcher_execute (screen, entry, filenames);
launcher_execute (screen, entry, filenames, event_time);
/* cleanup */
launcher_free_filenames (filenames);

6
plugins/launcher/launcher-exec.h

@ -22,8 +22,10 @@
void launcher_execute (GdkScreen *screen,
LauncherEntry *entry,
GSList *file_list) G_GNUC_INTERNAL;
GSList *file_list,
guint32 event_time) G_GNUC_INTERNAL;
void launcher_execute_from_clipboard (GdkScreen *screen,
LauncherEntry *entry) G_GNUC_INTERNAL;
LauncherEntry *entry,
guint32 event_time) G_GNUC_INTERNAL;
#endif /* !__XFCE_PANEL_EXEC_H__ */

12
plugins/launcher/launcher.c

@ -457,9 +457,9 @@ launcher_icon_button_released (GtkWidget *button,
/* execute the command on button 1 and 2 */
if (event->button == 1)
launcher_execute (screen, entry, NULL);
launcher_execute (screen, entry, NULL, event->time);
else if (event->button == 2)
launcher_execute_from_clipboard (screen, entry);
launcher_execute_from_clipboard (screen, entry, event->time);
}
return FALSE;
@ -492,7 +492,7 @@ launcher_icon_button_drag_data_received (GtkWidget *widget,
entry = g_list_first (launcher->entries)->data;
/* execute the entry with the filenames */
launcher_execute (gtk_widget_get_screen (widget), entry, filenames);
launcher_execute (gtk_widget_get_screen (widget), entry, filenames, time_);
/* cleanup */
launcher_free_filenames (filenames);
@ -651,9 +651,9 @@ launcher_menu_item_released (GtkWidget *mi,
if (G_LIKELY (entry))
{
if (event->button == 1)
launcher_execute (screen, entry, NULL);
launcher_execute (screen, entry, NULL, event->time);
else if (event->button == 2)
launcher_execute_from_clipboard (screen, entry);
launcher_execute_from_clipboard (screen, entry, event->time);
/* move the item to the first position in the list */
if (launcher->move_first
@ -703,7 +703,7 @@ launcher_menu_item_drag_data_received (GtkWidget *widget,
if (G_LIKELY (filenames))
{
/* execute the entry with the filenames */
launcher_execute (gtk_widget_get_screen (widget), entry, filenames);
launcher_execute (gtk_widget_get_screen (widget), entry, filenames, time_);
/* cleanup */
launcher_free_filenames (filenames);

Loading…
Cancel
Save