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