Commit 000179c7 authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

minor fixes, remove blocking as it is not needed

Sun May 03 03:35:05 1998  George Lebl  <jirka@5z.com>

        * panel-widget.[ch]: minor fixes, remove blocking
          as it is not needed

        * panel.c: minor fixes
parent e6c4f8ea
Sun May 03 03:35:05 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch]: minor fixes, remove blocking
as it is not needed
* panel.c: minor fixes
Sun May 03 02:52:40 1998 George Lebl <jirka@5z.com>
* panel.c: clean section before saving applet info
......
Sun May 03 03:35:05 1998 George Lebl <jirka@5z.com>
* panel-widget.[ch]: minor fixes, remove blocking
as it is not needed
* panel.c: minor fixes
Sun May 03 02:52:40 1998 George Lebl <jirka@5z.com>
* panel.c: clean section before saving applet info
......
......@@ -489,7 +489,7 @@ get_applet_data_pos(PanelWidget *panel, gint pos)
/*temporairly using _, we will switch over to this function completely
in time*/
static void
_panel_widget_applet_put(PanelWidget *panel,AppletData *ad)
panel_widget_applet_put(PanelWidget *panel,AppletData *ad)
{
gint width, height;
gint x,y;
......@@ -522,19 +522,13 @@ _panel_widget_applet_put(PanelWidget *panel,AppletData *ad)
}
}
static void
panel_widget_applet_put(PanelWidget *panel,gint pos)
{
_panel_widget_applet_put(panel,get_applet_data_pos(panel,pos));
}
static void
panel_widget_put_all(PanelWidget *panel)
{
GList *list;
for(list=panel->applet_list;list!=NULL;list=g_list_next(list))
_panel_widget_applet_put(panel,list->data);
panel_widget_applet_put(panel,list->data);
}
static void
......@@ -612,7 +606,7 @@ panel_widget_right_stick(PanelWidget *panel,gint old_size)
} while(ad->pos+ad->cells == i);
for(list = prev;list!=NULL;list=g_list_next(list))
_panel_widget_applet_put(panel,list->data);
panel_widget_applet_put(panel,list->data);
}
static gint
......@@ -649,7 +643,7 @@ panel_widget_push_left(PanelWidget *panel,AppletData *oad)
ad=list->data;
ad->pos--;
_panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,ad);
if(ad == oad)
break;
}
......@@ -698,7 +692,7 @@ panel_widget_push_right(PanelWidget *panel,AppletData *oad)
ad=list->data;
ad->pos++;
_panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,ad);
if(ad == oad)
break;
}
......@@ -712,14 +706,8 @@ panel_widget_seize_space(PanelWidget *panel,
AppletData *ad)
{
gint i;
gint orig_block = FALSE;
GList *list,*rlist,*llist;
if(ad==panel->currently_dragged_applet) {
orig_block = panel->drag_blocked;
panel->drag_blocked = TRUE;
}
if(width%PANEL_CELL_SIZE) width--; /*just so that I get
the right size*/
/*convert width from pixels to cells*/
......@@ -729,16 +717,11 @@ panel_widget_seize_space(PanelWidget *panel,
panel_widget_pack_applets(panel);
/*we already have enough space*/
if(width <= ad->cells) {
panel->drag_blocked = orig_block;
if(width <= ad->cells)
return;
}
list = g_list_find(panel->applet_list,ad);
if(!list) {
panel->drag_blocked = orig_block;
g_return_if_fail(list!=NULL);
}
g_return_if_fail(list!=NULL);
/*try how much free space is on the right*/
rlist = g_list_next(list);
......@@ -746,7 +729,6 @@ panel_widget_seize_space(PanelWidget *panel,
AppletData *wad = rlist->data;
if(ad->pos+width-1 < wad->pos) {
ad->cells = width;
panel->drag_blocked = orig_block;
return;
}
ad->cells = wad->pos - ad->pos;
......@@ -758,7 +740,6 @@ panel_widget_seize_space(PanelWidget *panel,
panel->size = ad->pos+width;
panel_widget_set_size(panel,panel->size);
}
panel->drag_blocked = orig_block;
return;
}
ad->cells = panel->size - ad->pos;
......@@ -771,8 +752,7 @@ panel_widget_seize_space(PanelWidget *panel,
if(wad->pos+wad->cells-1 < ad->pos+ad->cells-width) {
ad->pos = ad->pos+ad->cells-width;
ad->cells = width;
_panel_widget_applet_put(panel,ad);
panel->drag_blocked = orig_block;
panel_widget_applet_put(panel,ad);
return;
}
ad->cells += ad->pos-(wad->pos+wad->cells);
......@@ -781,8 +761,7 @@ panel_widget_seize_space(PanelWidget *panel,
if(0 <= ad->pos+ad->cells-width) {
ad->pos = ad->pos+ad->cells-width;
ad->cells = width;
_panel_widget_applet_put(panel,ad);
panel->drag_blocked = orig_block;
panel_widget_applet_put(panel,ad);
return;
}
ad->cells += ad->pos;
......@@ -804,9 +783,7 @@ panel_widget_seize_space(PanelWidget *panel,
}
}
_panel_widget_applet_put(panel,ad);
panel->drag_blocked = orig_block;
panel_widget_applet_put(panel,ad);
}
static void
......@@ -836,7 +813,7 @@ panel_widget_adjust_applet(PanelWidget *panel, AppletData *ad)
else
panel_widget_seize_space(panel,height,ad);
}
_panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,ad);
}
......@@ -852,15 +829,15 @@ panel_widget_switch_applet_right(PanelWidget *panel, GList *list)
nad = nlist->data;
if(!nlist || nad->pos > ad->pos+ad->cells) {
ad->pos++;
_panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,ad);
return;
}
nad->pos = ad->pos;
ad->pos = nad->pos+nad->cells;
panel->applet_list = my_g_list_swap_prev(panel->applet_list,nlist);
_panel_widget_applet_put(panel,ad);
_panel_widget_applet_put(panel,nad);
panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,nad);
}
static void
......@@ -875,15 +852,15 @@ panel_widget_switch_applet_left(PanelWidget *panel, GList *list)
pad = nlist->data;
if(!nlist || pad->pos+pad->cells < ad->pos) {
ad->pos--;
_panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,ad);
return;
}
ad->pos = pad->pos;
pad->pos = ad->pos+ad->cells;
panel->applet_list = my_g_list_swap_next(panel->applet_list,nlist);
_panel_widget_applet_put(panel,ad);
_panel_widget_applet_put(panel,pad);
panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,pad);
}
static gint
......@@ -2296,7 +2273,7 @@ panel_widget_nice_move(PanelWidget *panel, AppletData *ad, gint pos)
my_g_list_resort(panel->applet_list,ad,
(GCompareFunc)applet_data_compare);
_panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,ad);
}
......@@ -2304,9 +2281,6 @@ panel_widget_nice_move(PanelWidget *panel, AppletData *ad, gint pos)
gint
panel_widget_applet_move_to_cursor(PanelWidget *panel)
{
/*blocked, so don't do anything*/
if (panel->drag_blocked)
return TRUE;
if (panel->currently_dragged_applet) {
gint x,y;
gint moveby;
......@@ -2332,22 +2306,18 @@ panel_widget_applet_move_to_cursor(PanelWidget *panel)
pos = 0;
/*disable reentrancy into this
function*/
panel->drag_blocked = TRUE;
if(panel_widget_reparent(panel,
new_panel,
applet,
pos)==-1) {
pos)==-1)
/*can't find a free pos
so cancel the reparent*/
panel->drag_blocked = FALSE;
continue;
}
_panel_widget_applet_drag_end(panel);
_panel_widget_applet_drag_start(
new_panel, applet);
panel_widget_applet_move_use_idle(
new_panel);
panel->drag_blocked = FALSE;
return FALSE;
}
}
......@@ -2604,7 +2574,7 @@ panel_widget_make_empty_pos(PanelWidget *panel, gint pos)
if(list)
rad = list->data;
if(ad->pos+ad->cells < rad->pos)
if(!list || ad->pos+ad->cells < rad->pos)
return ad->pos+ad->cells;
if(panel_widget_push_right(panel,rad))
......@@ -2811,7 +2781,7 @@ panel_widget_move (PanelWidget *panel, GtkWidget *applet, gint pos)
g_list_insert_sorted(panel->applet_list,ad,
(GCompareFunc)applet_data_compare);
_panel_widget_applet_put(panel,ad);
panel_widget_applet_put(panel,ad);
return pos;
}
......@@ -2840,9 +2810,11 @@ panel_widget_remove (PanelWidget *panel, GtkWidget *applet)
/*remove applet*/
gtk_container_remove(GTK_CONTAINER(panel->fixed),applet);
if(panel->snapped==PANEL_DRAWER)
panel_widget_pack_applets(panel);
thick = panel_widget_get_thick(panel);
if(panel->thick != thick) {
panel->thick = thick;
......
......@@ -99,7 +99,6 @@ struct _PanelWidget
gint leave_notify_timer_tag;
AppletData *currently_dragged_applet;
gint drag_blocked;
DrawerDropZonePos drawer_drop_zone_pos;
gint x;
......
......@@ -756,20 +756,6 @@ applet_register (const char * ior, int applet_id)
orientation_change(applet_id,panel);
}
/* fixed in libgnomeui now
static gint
socket_destroy(GtkWidget *widget, gpointer data)
{
GtkSocket *socket = GTK_SOCKET(widget);
gdk_window_destroy_notify (socket->plug_window);
gdk_window_destroy (socket->plug_window);
socket->plug_window = NULL;
return FALSE;
}
*/
/*note that type should be APPLET_EXTERN_RESERVED or APPLET_EXTERN_PENDING
only*/
guint32
......@@ -780,11 +766,6 @@ reserve_applet_spot (const char *id_str, const char *path, int panel,
socket = gtk_socket_new();
/*fixed in libgnomeui now*/
/*gtk_signal_connect(GTK_OBJECT(socket),"destroy",
GTK_SIGNAL_FUNC(socket_destroy),
NULL);*/
g_return_val_if_fail(socket!=NULL,0);
gtk_widget_show (socket);
......@@ -914,6 +895,8 @@ applet_destroy(GtkWidget *w, gpointer data)
info->widget = NULL;
panel_clean_applet(applet_id);
return FALSE;
}
gint
......
......@@ -152,7 +152,6 @@ void orientation_change(gint applet_id, PanelWidget *panel);
# define ITOP(i) (gpointer)((gshort)i)
#endif
END_GNOME_DECLS
#endif
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