Browse Source

Remove or increase some timeouts and handle delete-event on the panel window (bug #2116).

(Old svn revision: 22645)
upstream/xfce4-panel-4.10.1
Jasper Huijsmans 17 years ago
parent
commit
a1bbe8edfc
  1. 15
      configure.ac.in
  2. 7
      panel/panel-app.c
  3. 4
      panel/panel-properties.c
  4. 7
      panel/panel.c
  5. 11
      plugins/launcher/launcher.c

15
configure.ac.in

@ -5,10 +5,21 @@ dnl
dnl 2005-2006 Jasper Huijsmans <jasper@xfce.org>
dnl
dnl version info
m4_define([xfce4_panel_version],[4.3.90.2])
dnl library version info
m4_define([libxfce4panel_verinfo], [2:0:1])
dnl panel version info
m4_define([xfce4_panel_version_major], [4])
m4_define([xfce4_panel_version_minor], [3])
m4_define([xfce4_panel_version_micro], [90])
m4_define([xfce4_panel_version_nano], [2]) dnl leave this empty to have no nano version
m4_define([xfce4_panel_version_build], [@REVISION@])
m4_define([xfce4_panel_version_tag], [svn])
m4_define([xfce4_panel_version], [xfce4_panel_version_major().xfce4_panel_version_minor().xfce4_panel_version_micro()ifelse(xfce4_panel_version_nano(), [], [], [.xfce4_panel_version_nano()])ifelse(xfce4_panel_version_tag(), [svn], [xfce4_panel_version_tag()-xfce4_panel_version_build()], [xfce4_panel_version_tag()])])
dnl init autoconf
AC_COPYRIGHT([Copyright (c) 2002-2006
The Xfce development team. All rights reserved.

7
panel/panel-app.c

@ -253,6 +253,10 @@ check_signal_state (void)
if (quit)
{
if (panel_app.save_id)
g_source_remove (panel_app.save_id);
panel_app.save_id = 0;
/* this is necessary, because the function is not only called from the
* timeout, so just returning FALSE is not enough. */
g_source_remove (panel_app.check_id);
@ -607,7 +611,7 @@ panel_app_run (int argc, char **argv)
/* Run Forrest, Run! */
panel_app.check_id =
g_timeout_add (250, (GSourceFunc) check_signal_state, NULL);
g_timeout_add (1000, (GSourceFunc) check_signal_state, NULL);
panel_app.runstate = PANEL_RUN_STATE_NORMAL;
TIMER_ELAPSED("start main loop");
gtk_main ();
@ -684,6 +688,7 @@ panel_app_restart (void)
void
panel_app_quit (void)
{
panel_app_save();
panel_app.runstate = PANEL_RUN_STATE_QUIT;
check_signal_state ();
}

4
panel/panel-properties.c

@ -1181,10 +1181,6 @@ panel_set_screen_position (Panel *panel, XfceScreenPosition position)
priv->xoffset = priv->yoffset = 0;
}
/* let changes take effect */
while (gtk_events_pending ())
gtk_main_iteration ();
xfce_panel_window_set_move_function (XFCE_PANEL_WINDOW (panel),
(XfcePanelWindowMoveFunc)panel_move_function, panel);

7
panel/panel.c

@ -256,6 +256,9 @@ panel_init (Panel * panel)
gtk_widget_show (priv->itembar);
gtk_container_add (GTK_CONTAINER (panel), priv->itembar);
/* don't allow the wm to close the panel window */
g_signal_connect (panel, "delete-event", G_CALLBACK (gtk_true), NULL);
/* DND */
g_signal_connect (priv->itembar, "drag-data-received",
G_CALLBACK (_panel_drag_data_received), panel);
@ -520,7 +523,7 @@ _panel_drag_begin (GtkWidget *widget, GdkDragContext *drag_context,
plugin = priv->drag_widget;
/* allow menu to close, in order to not mess up the snapshot of the
* plugin */
* plugin -- TODO: find a better way to do this */
while (gtk_events_pending ())
gtk_main_iteration ();
}
@ -763,7 +766,7 @@ panel_free_data (Panel *panel)
{
DBG (" + %d item(s) on the panel",
xfce_itembar_get_n_items (XFCE_ITEMBAR (priv->itembar)));
g_usleep (100000); /* 1/10 sec */
g_usleep (200000); /* 0.2 sec */
while (gtk_events_pending ())
gtk_main_iteration ();

11
plugins/launcher/launcher.c

@ -750,13 +750,6 @@ launcher_update_panel_entry (LauncherPlugin *launcher)
gtk_tooltips_set_tip (launcher->tips, launcher->iconbutton, tip, NULL);
}
static gboolean
update_panel_entry_idle (LauncherPlugin *launcher)
{
launcher_update_panel_entry (launcher);
return FALSE;
}
static void
launcher_position_menu (GtkMenu * menu, int *x, int *y, gboolean * push_in,
GtkWidget *b)
@ -1044,7 +1037,7 @@ launcher_read_rc_file (XfcePanelPlugin *plugin, LauncherPlugin *launcher)
xfce_rc_close (rc);
g_idle_add ((GSourceFunc)update_panel_entry_idle, launcher);
launcher_update_panel_entry (launcher);
launcher_recreate_menu (launcher);
}
@ -1307,7 +1300,7 @@ launcher_new (XfcePanelPlugin *plugin)
g_ptr_array_add (launcher->entries, entry);
g_idle_add ((GSourceFunc)update_panel_entry_idle, launcher);
launcher_update_panel_entry (launcher);
}
else if (launcher->entries->len > 1)
{

Loading…
Cancel
Save