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

reparenting mess hopefully cleaned up. (there are two separate calls for

Sun Feb 22 02:58:00 1998  George Lebl  <jirka@5z.com>

        * applet-lib.cc, panel.c: reparenting mess hopefully cleaned
          up. (there are two separate calls for setting up an
          applet now)
parent 46f3c38b
Sun Feb 22 02:58:00 1998 George Lebl <jirka@5z.com>
* applet-lib.cc, panel.c: reparenting mess hopefully cleaned
up. (there are two separate calls for setting up an
applet now)
Sat Feb 21 22:26:26 1998 George Lebl <jirka@5z.com>
* clock.c: took out the debugging button
......
Sun Feb 22 02:58:00 1998 George Lebl <jirka@5z.com>
* applet-lib.cc, panel.c: reparenting mess hopefully cleaned
up. (there are two separate calls for setting up an
applet now)
Sat Feb 21 22:26:26 1998 George Lebl <jirka@5z.com>
* clock.c: took out the debugging button
......
......@@ -16,11 +16,16 @@ char *first_ior_sent;
class Panel_impl : virtual public GNOME::Panel_skel {
public:
CORBA::Short reparent_window_id (const char *ior,
CORBA:: CORBA::ULong wid,
void reparent_window_id (CORBA::ULong wid,
CORBA::Short id) {
printf ("REPARENT!\n");
::reparent_window_id (wid,id);
}
CORBA::Short reserve_applet_spot (const char *ior,
CORBA::Short panel,
CORBA::Short pos) {
printf ("REPARENT!\n");
printf ("RESERVE_APPLET_SPOT!\n");
printf ("applet registered with IOR: %s\n", ior);
/*
......@@ -31,7 +36,7 @@ public:
*/
first_ior_sent = g_strdup (ior);
return ::reparent_window_id (wid,panel,pos);
return ::reserve_applet_spot (panel,pos);
}
CORBA::Short applet_get_panel (CORBA::Short id) {
printf ("APPLET_GET_PANEL!\n");
......
......@@ -520,85 +520,47 @@ applet_drag_stop(int id)
panel_widget_applet_drag_end_no_grab(panel);
}
/*int
applet_button_press_event(int id, int button)
void
reparent_window_id (unsigned long winid, int id)
{
puts("BUTTONPRESS1");
if(button==3) {
AppletInfo *info = g_list_nth(applets,id)->data;
puts("BUTTONPRESS2");
show_applet_menu(info);
puts("BUTTONPRESS3");
return TRUE;
} else if(button == 2) {
AppletInfo *info = g_list_nth(applets,id)->data;
PanelWidget *panel = find_applet_panel(info->widget);
puts("BUTTONPRESS4");
panel_widget_applet_drag_start(panel,info->widget);
puts("BUTTONPRESS5");
return TRUE;
}
return FALSE;
}*/
GtkWidget *eb;
GdkWindow *win;
int w,h;
printf ("I got this window ID to reparent: %d\n", winid);
/*FIXME: check for NULLS!*/
eb = ((AppletInfo *)(g_list_nth(applets,id)->data))->widget;
struct reparent_struct {
GtkWidget *panel;
GdkWindow *win;
GdkWindow *target;
};
win = gdk_window_foreign_new(winid);
gdk_window_get_size(win,&w,&h);
printf ("setting window size to: %d %d\n", w, h);
gtk_widget_set_usize(eb,w,h);
int
delayed_reparent_window_id (gpointer data)
{
struct reparent_struct *rs = data;
int i;
gdk_window_reparent(win,eb->window,0,0);
printf ("delayed in\n");
for (i = 0; i < 200; i++){
gdk_window_reparent(rs->win,rs->target,0,0);
gdk_flush ();
}
g_free (rs);
printf ("delayed out\n");
gtk_widget_draw(rs->panel, NULL);
return 0;
printf ("leaving reparent\n");
}
int
reparent_window_id (unsigned long id, int panel, int pos)
reserve_applet_spot (int panel, int pos)
{
struct reparent_struct *rs = g_new (struct reparent_struct, 1);
GtkWidget *eb;
GdkWindow *win;
GList *list;
int w,h;
int i;
printf ("I got this window ID to reparent: %d\n", id);
eb = gtk_event_box_new();
printf ("entering reserve spot\n");
win = gdk_window_foreign_new(id);
gdk_window_get_size(win,&w,&h);
printf ("setting window size to: %d %d\n", w, h);
gtk_widget_set_usize(eb,w,h);
eb = gtk_event_box_new();
gtk_widget_show (eb);
register_toy(eb,NULL,"External",NULL,pos,panel,0,APPLET_EXTERN);
rs->win = win;
rs->target = eb->window;
rs->panel = g_list_nth(panels,panel)->data;
gtk_idle_add (delayed_reparent_window_id, (gpointer) rs);
printf ("leaving reparent\n");
for(i=0,list=applets;list!=NULL;list=g_list_next(list))
i++;
printf ("leaving reserve spot\n");
return i-1;
}
......@@ -613,7 +575,9 @@ add_reparent(GtkWidget *widget, gpointer data)
puts("Enter window ID to reparent:");
scanf("%d",&id);
(void)reparent_window_id (id,0,0);
appletid = reserve_applet_spot(0,0);
reparent_window_id (id,appletid);
}
static void
......
......@@ -81,7 +81,8 @@ void panel_quit(void);
void apply_global_config(void);
int reparent_window_id (unsigned long id, int panel, int pos);
void reparent_window_id (unsigned long winid, int id);
int reserve_applet_spot (int panel, int pos);
/*stuff for corba*/
int applet_get_panel(int id);
......
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