From 26049351e09d75bdf8b35273a76cf65202583fa7 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 27 May 2010 17:20:18 +0000 Subject: Better device hierarchy with surfaces and graphics drivers. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_x.cxx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src/Fl_x.cxx') diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 1c81503f8..5b7f2c520 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -51,9 +51,11 @@ # include # include -static Fl_Xlib_Display fl_xlib_device; -FL_EXPORT Fl_Display *fl_display_device = (Fl_Display*)&fl_xlib_device; // does not change -FL_EXPORT Fl_Device *fl_device = (Fl_Device*)&fl_xlib_device; // the current target device of graphics operations +static Fl_Xlib_Graphics_Driver fl_xlib_driver; +static Fl_Display_Device fl_xlib_display(&fl_xlib_driver); +FL_EXPORT Fl_Display_Device *fl_display_device = (Fl_Display_Device*)&fl_xlib_display; // does not change +FL_EXPORT Fl_Graphics_Driver *fl_device = (Fl_Graphics_Driver*)&fl_xlib_driver; // the current target device of graphics operations +FL_EXPORT Fl_Surface_Device *fl_surface = (Fl_Surface_Device*)fl_display_device; // the current target surface of graphics operations //////////////////////////////////////////////////////////////// // interface to poll/select call: @@ -136,9 +138,7 @@ void Fl::add_fd(int n, void (*cb)(int, void*), void* v) { void Fl::remove_fd(int n, int events) { int i,j; -# if !USE_POLL maxfd = -1; // recalculate maxfd on the fly -# endif for (i=j=0; i maxfd) maxfd = fd[i].fd; # endif + if (fd[i].fd > maxfd) maxfd = fd[i].fd; // move it down in the array if necessary: if (jmenu_window() || win->tooltip_window()) { - Atom net_wm_type = XInternAtom(fl_display, "_NET_WM_WINDOW_TYPE", False); - Atom net_wm_type_kind = XInternAtom(fl_display, "_NET_WM_WINDOW_TYPE_MENU", False); - int ret = XChangeProperty(fl_display, xp->xid, net_wm_type, XA_ATOM, 32, PropModeReplace, (unsigned char*)&net_wm_type_kind, 1); - } - XMapWindow(fl_display, xp->xid); if (showit) { win->set_visible(); -- cgit v1.2.3