Question about gdk_window_foreign_new.



Dear all,
   I am using Xfce4, and I want to draw something on xfdesktop4.
   So I got its gdk_window, and create a cairo context on it.

 GdkDrawable *window;
 cairo_t *cc;
 window = gdk_window_foreign_new (netk_window_get_xid (g_list_first
(netk_screen_get_windows_stacked (netk_screen_get_default ()))->data));
 if (window == NULL) {
   g_print ("wrong");
   return 0;
 }
 cc = gdk_cairo_create (window);

   But as I drew a white line on cc, the desktop window became black,
with a white line on it. While xfdesktop4 was still running, menu or
something worked well.

   Why does this happen? Thanks.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]