Commit 39195f2b authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

got rid of the ugly inhibit allocates hack.

Sun Jul 12 02:53:55 1998  George Lebl  <jirka@5z.com>

        * panel-widget.c: got rid of the ugly inhibit allocates
          hack.

        * panel.c: we can just do gtk_main_quit in _die and we don't
          need the slow destruction of everything.

        * panel.c: MICO BUG! well the gtk bindings one anyhow, basically
          gtk_main_quit() won't work here since ->run goes in an infinite
          loop as it seems and doesn't care about return value as it
          it should ... so what I do is to put gtk_exit in an idle handler
          so that I  don't quit right away but soon ....
parent c8e3ee59
Sun Jul 12 02:53:55 1998 George Lebl <jirka@5z.com>
* panel-widget.c: got rid of the ugly inhibit allocates
hack.
* panel.c: we can just do gtk_main_quit in _die and we don't
need the slow destruction of everything.
* panel.c: MICO BUG! well the gtk bindings one anyhow, basically
gtk_main_quit() won't work here since ->run goes in an infinite
loop as it seems and doesn't care about return value as it
it should ... so what I do is to put gtk_exit in an idle handler
so that I don't quit right away but soon ....
Sun Jul 12 02:07:52 1998 George Lebl <jirka@5z.com>
* main.[ch],panel.[ch],menu.c: cleanups, plus we no longer
......
Sun Jul 12 02:53:55 1998 George Lebl <jirka@5z.com>
* panel-widget.c: got rid of the ugly inhibit allocates
hack.
* panel.c: we can just do gtk_main_quit in _die and we don't
need the slow destruction of everything.
* panel.c: MICO BUG! well the gtk bindings one anyhow, basically
gtk_main_quit() won't work here since ->run goes in an infinite
loop as it seems and doesn't care about return value as it
it should ... so what I do is to put gtk_exit in an idle handler
so that I don't quit right away but soon ....
Sun Jul 12 02:07:52 1998 George Lebl <jirka@5z.com>
* main.[ch],panel.[ch],menu.c: cleanups, plus we no longer
......
......@@ -28,8 +28,6 @@ extern int pw_minimize_delay;
extern int pw_disable_animations;
extern PanelMovementType pw_movement_type;
extern int panel_widget_inhibit_allocates;
/************************
widget core
************************/
......@@ -123,8 +121,6 @@ corner_widget_class_init (CornerWidgetClass *class)
static void
corner_widget_set_position(CornerWidget *corner)
{
int xcor = 0;
int ycor = 0;
int x,y;
int newx,newy;
int width,height;
......
......@@ -30,8 +30,6 @@ extern int pw_minimize_delay;
extern int pw_disable_animations;
extern PanelMovementType pw_movement_type;
extern int panel_widget_inhibit_allocates;
typedef void (*StateSignal) (GtkObject * object,
DrawerState state,
gpointer data);
......@@ -594,7 +592,6 @@ drawer_widget_set_pos(DrawerWidget *drawer, int x, int y)
void
drawer_widget_restore_state(DrawerWidget *drawer)
{
PanelWidget *panel = PANEL_WIDGET(drawer->panel);
gtk_widget_set_uposition(GTK_WIDGET(drawer),drawer->x,drawer->y);
gtk_widget_show(GTK_WIDGET(drawer));
}
......
......@@ -62,9 +62,6 @@ GtkTooltips *panel_tooltips = NULL;
GnomeClient *client = NULL;
/*we'll use this as an indivation that we're shutting down*/
extern int panel_widget_inhibit_allocates;
GlobalConfig global_config = {
DEFAULT_AUTO_HIDE_STEP_SIZE,
DEFAULT_EXPLICIT_HIDE_STEP_SIZE,
......@@ -982,7 +979,6 @@ panel_applet_added(GtkWidget *widget, GtkWidget *applet, gpointer data)
{
int applet_id = PTOI(gtk_object_get_user_data(GTK_OBJECT(applet)));
AppletInfo *info = get_applet_info(applet_id);
PanelWidget *panel = PANEL_WIDGET(widget);
GtkWidget *panelw = gtk_object_get_data(GTK_OBJECT(widget),
PANEL_PARENT);
......@@ -1020,22 +1016,19 @@ count_open_drawers(gpointer data, gpointer user_data)
DrawerWidget *dw = gtk_object_get_data(GTK_OBJECT(info->assoc),
PANEL_PARENT);
if(dw->state == DRAWER_SHOWN)
*count ++;
(*count)++;
}
}
static void
panel_applet_removed(GtkWidget *widget, GtkWidget *applet, gpointer data)
{
PanelWidget *panel = PANEL_WIDGET(widget);
GtkWidget *parentw = gtk_object_get_data(GTK_OBJECT(panel),
GtkWidget *parentw = gtk_object_get_data(GTK_OBJECT(widget),
PANEL_PARENT);
if(panel_widget_inhibit_allocates)
return;
if(IS_SNAPPED_WIDGET(parentw)) {
int drawers_open = 0;
panel_widget_foreach(panel,
panel_widget_foreach(PANEL_WIDGET(widget),
count_open_drawers,
&drawers_open);
SNAPPED_WIDGET(parentw)->drawers_open = drawers_open;
......@@ -1296,8 +1289,6 @@ applet_move_foreach(gpointer data, gpointer user_data)
static void
panel_applet_move(GtkWidget *panel,GtkWidget *widget, gpointer data)
{
if(panel_widget_inhibit_allocates)
return;
applet_move_foreach(widget,NULL);
config_changed = TRUE;
}
......@@ -1571,11 +1562,10 @@ panel_setup(GtkWidget *panelw)
"size_allocate",
GTK_SIGNAL_FUNC(panel_size_allocate),
NULL);
pd->destroy_callback =
gtk_signal_connect(GTK_OBJECT(panelw),
"destroy",
GTK_SIGNAL_FUNC(panel_destroy),
panel_menu);
gtk_signal_connect(GTK_OBJECT(panelw),
"destroy",
GTK_SIGNAL_FUNC(panel_destroy),
panel_menu);
/*with this we capture button presses throughout all the widgets of the
panel*/
......
......@@ -19,7 +19,6 @@ typedef struct _PanelData PanelData;
struct _PanelData {
PanelType type;
GtkWidget *panel;
int destroy_callback;
};
/*get the default panel widget if the panel has more then one or
......
......@@ -703,6 +703,7 @@ create_new_panel(GtkWidget *w,gpointer data)
panel_setup(panel);
gtk_widget_show(panel);
break;
default: break;
}
}
......@@ -934,8 +935,9 @@ menu_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data)
}
/*this HAS to be set everytime we popup the menu*/
current_panel = gtk_object_get_data(menu->button->parent,
PANEL_APPLET_PARENT_KEY);
current_panel =
gtk_object_get_data(GTK_OBJECT(menu->button->parent),
PANEL_APPLET_PARENT_KEY);
gtk_menu_popup(GTK_MENU(menu->menu), 0,0, menu_position,
data, event->button, event->time);
......
......@@ -35,8 +35,6 @@ int pw_minimize_delay = 300;
int pw_disable_animations = FALSE;
PanelMovementType pw_movement_type = PANEL_SWITCH_MOVE;
int panel_widget_inhibit_allocates = FALSE;
static char *image_drop_types[] = {"url:ALL", "application/x-color"};
/*this is a queue of panels we want to send applet_move to all it's applets,
......@@ -245,9 +243,6 @@ panel_widget_class_init (PanelWidgetClass *class)
void
panel_widget_set_size(PanelWidget *panel)
{
if(panel_widget_inhibit_allocates)
return;
if(panel->packed) {
int w,h;
if(panel->orient == PANEL_HORIZONTAL) {
......@@ -297,9 +292,6 @@ panel_widget_put_all(PanelWidget *panel,int force)
{
GList *list;
if(panel_widget_inhibit_allocates)
return;
for(list=panel->applet_list;list!=NULL;list=g_list_next(list))
panel_widget_applet_put(panel,list->data,force);
}
......@@ -348,9 +340,6 @@ panel_widget_pack_applets(PanelWidget *panel)
int i;
GList *list;
if(panel_widget_inhibit_allocates)
return;
for(list=panel->applet_list,i=0;list!=NULL;list=g_list_next(list)) {
AppletData *ad = list->data;
ad->pos = i;
......@@ -513,9 +502,6 @@ panel_widget_get_thick(PanelWidget *panel)
g_return_val_if_fail(panel,PANEL_MINIMUM_WIDTH);
if(panel_widget_inhibit_allocates)
return panel->thick;
if(panel->orient==PANEL_HORIZONTAL) {
for(list=panel->applet_list;list!=NULL;list=g_list_next(list)) {
AppletData *ad = list->data;
......@@ -779,9 +765,6 @@ panel_widget_apply_size_limit(PanelWidget *panel)
int old_size;
GList *list;
if(panel_widget_inhibit_allocates)
return;
g_return_if_fail(panel);
old_size = panel->size;
......@@ -817,8 +800,7 @@ panel_widget_adjust_applet(PanelWidget *panel, AppletData *ad)
{
int width, height;
if(panel_widget_inhibit_allocates ||
panel->postpone_adjust)
if(panel->postpone_adjust)
return;
g_return_if_fail(ad!=NULL);
......@@ -887,9 +869,6 @@ panel_widget_applet_size_allocate (GtkWidget *widget,
PanelWidget *panel;
AppletData *ad;
if(panel_widget_inhibit_allocates)
return FALSE;
panel = gtk_object_get_data(GTK_OBJECT(widget),PANEL_APPLET_PARENT_KEY);
ad = gtk_object_get_data(GTK_OBJECT(widget),PANEL_APPLET_DATA);
......@@ -938,11 +917,6 @@ adjust_applets_idle(gpointer data)
static int
send_move_idle(gpointer data)
{
if(panel_widget_inhibit_allocates) {
send_move_idle_id = 0;
return FALSE;
}
while(send_panels) {
GList *list;
PanelWidget *panel = send_panels->data;
......@@ -966,8 +940,7 @@ void
panel_widget_send_move(PanelWidget *panel)
{
int x,y,w,h;
if(panel_widget_inhibit_allocates ||
!GTK_WIDGET_REALIZED(GTK_WIDGET(panel)))
if(!GTK_WIDGET_REALIZED(GTK_WIDGET(panel)))
return;
gdk_window_get_origin(GTK_WIDGET(panel)->window,&x,&y);
......@@ -995,8 +968,7 @@ panel_widget_fixed_size_allocate(GtkWidget *widget,
{
PanelWidget *panel = data;
if(panel_widget_inhibit_allocates ||
!GTK_WIDGET_REALIZED(widget))
if(!GTK_WIDGET_REALIZED(widget))
return FALSE;
if(!panel->packed)
......@@ -1028,9 +1000,6 @@ panel_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocation,
panel_widget_apply_size_limit(panel);*/
/*GList *list;
if(panel_widget_inhibit_allocates)
return FALSE;
if(!GTK_WIDGET_REALIZED(widget))
return FALSE;
......@@ -1848,18 +1817,16 @@ panel_widget_applet_destroy(GtkWidget *applet, gpointer data)
panel->applet_list = g_list_remove(panel->applet_list,ad);
g_free(ad);
if(!panel_widget_inhibit_allocates) {
if(p)
remove_panel_from_forbidden(panel,p);
if(panel->packed)
panel_widget_pack_applets(panel);
if(p)
remove_panel_from_forbidden(panel,p);
thick = panel_widget_get_thick(panel);
if(panel->thick != thick || panel->packed) {
panel->thick = thick;
panel_widget_set_size(panel);
}
if(panel->packed)
panel_widget_pack_applets(panel);
thick = panel_widget_get_thick(panel);
if(panel->thick != thick || panel->packed) {
panel->thick = thick;
panel_widget_set_size(panel);
}
gtk_signal_emit(GTK_OBJECT(panel),
panel_widget_signals[APPLET_REMOVED_SIGNAL],
......@@ -2233,19 +2200,17 @@ panel_widget_remove (PanelWidget *panel, GtkWidget *applet)
gtk_widget_ref(applet);
gtk_container_remove(GTK_CONTAINER(panel->fixed),applet);
if(!panel_widget_inhibit_allocates) {
if(p)
remove_panel_from_forbidden(panel,p);
if(p)
remove_panel_from_forbidden(panel,p);
if(panel->packed)
panel_widget_pack_applets(panel);
if(panel->packed)
panel_widget_pack_applets(panel);
thick = panel_widget_get_thick(panel);
if(panel->thick != thick || panel->packed) {
panel->thick = thick;
panel_widget_set_size(panel);
}
thick = panel_widget_get_thick(panel);
if(panel->thick != thick || panel->packed) {
panel->thick = thick;
panel_widget_set_size(panel);
}
gtk_signal_emit(GTK_OBJECT(panel),
......
......@@ -51,8 +51,6 @@ extern GlobalConfig global_config;
extern char *panel_cfg_path;
extern char *old_panel_cfg_path;
extern int panel_widget_inhibit_allocates;
/*list of started applets*/
extern GList * children;
......@@ -318,49 +316,29 @@ panel_session_save (GnomeClient *client,
return TRUE;
}
static int
do_exit(gpointer data)
{
gtk_exit(0);
return FALSE;
}
int
panel_session_die (GnomeClient *client,
gpointer client_data)
{
int i;
AppletInfo *info;
gtk_timeout_remove(config_sync_timeout);
/*we don't need to do any gemotery stuff now, plus it might
actually hurt us*/
panel_widget_inhibit_allocates = TRUE;
/*don't catch these any more*/
signal(SIGCHLD, SIG_DFL);
puts("1");
/*don't catch these either*/
for(i=0,info=(AppletInfo *)applets->data;
i<applet_count;
i++,info++) {
if(info->widget)
gtk_signal_disconnect(GTK_OBJECT(info->widget),
info->destroy_callback);
}
puts("2");
while(panel_list) {
PanelData *pd = panel_list->data;
panel_list = g_list_remove_link(panel_list,panel_list);
gtk_signal_disconnect(GTK_OBJECT(pd->panel),
pd->destroy_callback);
gtk_widget_destroy(pd->panel);
}
puts("3");
/*clean up corba stuff*/
panel_corba_clean_up();
gtk_main_quit ();
/*FIXME: MICO BUG!!!!! the mico main will go on forever!!!!
this is a problem, so we'll do gtk_exit in an idle handler*/
/*gtk_main_quit ();*/
gtk_idle_add(do_exit,NULL);
return TRUE;
}
......@@ -390,7 +368,6 @@ panel_really_logout(GtkWidget *w, int button, gpointer data)
panel_session_save (client, 1, GNOME_SAVE_BOTH, 1,
GNOME_INTERACT_NONE, 0, NULL);
panel_session_die (client, NULL);
gtk_exit (0);
} else {
/* We request a completely interactive, full,
slow shutdown. */
......
......@@ -28,8 +28,6 @@ extern int pw_minimize_delay;
extern int pw_disable_animations;
extern PanelMovementType pw_movement_type;
extern int panel_widget_inhibit_allocates;
/************************
widget core
************************/
......
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