Commit 13964d90 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

fixed popup menu segfault, few sanity checks in menu_pos code

Wed Apr 22 01:46:49 1998  George Lebl  <jirka@5z.com>

        * panel.c: fixed popup menu segfault, few sanity
          checks in menu_pos code
parent 4df7cd25
Wed Apr 22 01:46:49 1998 George Lebl <jirka@5z.com>
* panel.c: fixed popup menu segfault, few sanity
checks in menu_pos code
Wed Apr 22 00:20:04 1998 George Lebl <jirka@5z.com>
* drawer.c: actually set orientations of drawer's panel
......
Wed Apr 22 01:46:49 1998 George Lebl <jirka@5z.com>
* panel.c: fixed popup menu segfault, few sanity
checks in menu_pos code
Wed Apr 22 00:20:04 1998 George Lebl <jirka@5z.com>
* drawer.c: actually set orientations of drawer's panel
......
......@@ -208,7 +208,7 @@ save_panel_configuration(gpointer data, gpointer user_data)
static void
destroy_widget_list(gpointer data, gpointer user_data)
{
gtk_widget_destroy(GTK_WIDGET(data));
gtk_widget_unref(GTK_WIDGET(data));
}
/* This is called when the session manager requests a shutdown. It
......@@ -272,13 +272,14 @@ panel_session_save (GnomeClient *client,
g_list_foreach(panels,destroy_widget_list,NULL);
/* clean programming goeas aside, this was causing too many segfaults,
exit will do the same thing anyhow*/
#if 0
for(i=0,info=(AppletInfo *)applets->data;i<applet_count;
i++,info++)
if(info->menu)
gtk_widget_unref(info->menu);
g_array_free(applets,TRUE);
gtk_object_unref(GTK_OBJECT (panel_tooltips));
/*prevent searches through the g_list to speed
......@@ -286,6 +287,7 @@ panel_session_save (GnomeClient *client,
small_icons = NULL;
gtk_widget_unref(root_menu);
#endif
/*clean up corba stuff*/
panel_corba_clean_up();
......@@ -294,6 +296,10 @@ panel_session_save (GnomeClient *client,
puts("killing launcher");
kill(launcher_pid,SIGTERM);
#endif
/*
g_array_free(applets,TRUE);
*/
gtk_exit (0);
}
......@@ -342,9 +348,8 @@ panel_clean_applet(gint applet_id)
panel = gtk_object_get_data(GTK_OBJECT(info->widget),
PANEL_APPLET_PARENT_KEY);
g_return_if_fail(panel != NULL);
panel_widget_remove(panel,info->widget);
if(panel)
panel_widget_remove(panel,info->widget);
}
info->widget = NULL;
info->applet_widget = NULL;
......@@ -434,8 +439,13 @@ applet_menu_position (GtkMenu *menu, gint *x, gint *y, gpointer data)
{
int wx, wy;
AppletInfo *info = get_applet_info(PTOI(data));
PanelWidget *panel = gtk_object_get_data(GTK_OBJECT(info->widget),
PANEL_APPLET_PARENT_KEY);
PanelWidget *panel;
g_return_if_fail(info != NULL);
g_return_if_fail(info->widget != NULL);
panel = gtk_object_get_data(GTK_OBJECT(info->widget),
PANEL_APPLET_PARENT_KEY);
g_return_if_fail(panel != NULL);
......@@ -537,7 +547,7 @@ applet_show_menu(gint applet_id)
arrow = gdk_cursor_new(GDK_ARROW);
gtk_menu_popup(GTK_MENU(info->menu), NULL, NULL, applet_menu_position,
info, 0/*3*/, time(NULL));
ITOP(applet_id), 0/*3*/, time(NULL));
gtk_grab_add(info->menu);
gdk_pointer_grab(info->menu->window,
TRUE,
......
......@@ -130,7 +130,8 @@ void load_applet(char *id, char *params, int pos, int panel, char *cfgpath);
void orientation_change(gint applet_id, PanelWidget *panel);
#define get_applet_info(applet_id) \
(&g_array_index(applets,AppletInfo,applet_id))
((applet_id>=0 && applet_id<applet_count) ? \
(&g_array_index(applets,AppletInfo,applet_id)):NULL)
/*a few macros to reduce compiler warnings*/
#if (SIZEOF_INT == SIZEOF_VOID_P)
......
......@@ -2,13 +2,10 @@
#this is a temporary script to launch the launcher and the panel
#this will kill the launcher from before if it is still running
#it shouldn't have to be done, instead we should only launch one
#launcher_applet and that should be persistent though more then
#one panel sessions. that works but I've had it not work a few
#times so this works 100% even though it's not very "clean"
#it's a little dirty, but it works
kill `ps x|awk '/[l]auncher_applet/ {print $1}'`
#now started in panel binary
#kill `ps x|awk '/[l]auncher_applet/ {print $1}'`
#launcher_applet &
panel
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment