diff options
| author | Bill Spitzak <spitzak@gmail.com> | 1999-02-03 08:43:35 +0000 |
|---|---|---|
| committer | Bill Spitzak <spitzak@gmail.com> | 1999-02-03 08:43:35 +0000 |
| commit | 8009fef12cb88c5d4944bdad9a1e641c282df303 (patch) | |
| tree | 9c3cacadf5121dba5ee5ab42327ba6a9ab79402a /src/Fl_Menu_Window.cxx | |
| parent | 0434a826d57f5de3ef258532cc090717db574d4e (diff) | |
Put Fl::grab() into it's own source file. Rewritten as suggested so that
it takes a window pointer, and grab(0) releases. You can now call grab
repeatedly with the same or different values without it failing. The old
Fl::grab() and Fl::release() are emulated in inline functions in Fl.H
Added Fl_Menu_::copy(Fl_Menu_Item*), which will be useful for fluid, although
that use is nyi.
Fixes and cleanup to the code for Fl_Menu_::add(...).
git-svn-id: file:///fltk/svn/fltk/trunk@268 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Menu_Window.cxx')
| -rw-r--r-- | src/Fl_Menu_Window.cxx | 63 |
1 files changed, 2 insertions, 61 deletions
diff --git a/src/Fl_Menu_Window.cxx b/src/Fl_Menu_Window.cxx index ad4cdaf9e..16248115a 100644 --- a/src/Fl_Menu_Window.cxx +++ b/src/Fl_Menu_Window.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_Window.cxx,v 1.7 1999/01/07 19:17:23 mike Exp $" +// "$Id: Fl_Menu_Window.cxx,v 1.8 1999/02/03 08:43:33 bill Exp $" // // Menu window code for the Fast Light Tool Kit (FLTK). // @@ -96,65 +96,6 @@ Fl_Menu_Window::~Fl_Menu_Window() { hide(); } -//////////////////////////////////////////////////////////////// -// "Grab" is done while menu systems are up. This has several effects: -// Events are all sent to the "grab window", which does not even -// have to be displayed (and in the case of Fl_Menu.C it isn't). -// Under X override_redirect and save_under is done to new windows. -// The system is also told to "grab" events and send them to this app. - -extern void fl_fix_focus(); - -#ifdef WIN32 -// We have to keep track of whether we have captured the mouse, since -// MSWindows shows little respect for this... Grep for fl_capture to -// see where and how this is used. -HWND fl_capture; -#endif - -void Fl::grab(Fl_Window& w) { - grab_ = &w; -#ifdef WIN32 - SetActiveWindow(fl_capture = fl_xid(first_window())); - SetCapture(fl_capture); -#else - XGrabPointer(fl_display, - fl_xid(first_window()), - 1, - ButtonPressMask|ButtonReleaseMask| - ButtonMotionMask|PointerMotionMask, - GrabModeAsync, - GrabModeAsync, - None, - 0, - fl_event_time); - XGrabKeyboard(fl_display, - fl_xid(first_window()), - 1, - GrabModeAsync, - GrabModeAsync, - fl_event_time); -#endif -} - -extern void fl_send_extra_move(); // in Fl.cxx - -void Fl::release() { - grab_ = 0; -#ifdef WIN32 - fl_capture = 0; - ReleaseCapture(); -#else - XUngrabKeyboard(fl_display, fl_event_time); - XUngrabPointer(fl_display, fl_event_time); - // this flush is done in case the picked menu item goes into - // an infinite loop, so we don't leave the X server locked up: - XFlush(fl_display); -#endif - fl_send_extra_move(); - return; -} - // -// End of "$Id: Fl_Menu_Window.cxx,v 1.7 1999/01/07 19:17:23 mike Exp $". +// End of "$Id: Fl_Menu_Window.cxx,v 1.8 1999/02/03 08:43:33 bill Exp $". // |
