summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>2000-06-03 08:37:09 +0000
committerBill Spitzak <spitzak@gmail.com>2000-06-03 08:37:09 +0000
commitb0cdb25d3cf5e3016ce14d889a357cd963ba876d (patch)
tree9add6102de13b9ba92d548d19d8b2e2ae0387b9e /src/Fl.cxx
parentfa364dc13e591c9a0362a297e0369575bd4bb718 (diff)
Fixes for 1.0.8 I found:
Fixed hardware overlays. The problem was the new fl_clipped() code, which tests against the current window size. The hardware overlay code did not set the current window when drawing the overlay. I needed hardware overlay for DD's code, I'm not sure if these fixes are good enough to enable this in our general release. Hardware overlay still only works on SGI Irix. Some patches to turn off the MSVC++ -Oa (assumme no aliasing) optimization flag. Suprisingly this only broke a few parts of fltk, or at least these are the only ones I found. Does not unmap child windows when the main window is iconized. This reduces flashing when the window is deiconized. Fl::key() is set to zero by all events except key down/up. This will allow you to reliably test if an event or callback was produced by a keystroke. Fixes the bug posted about stopping Escape from closing the window. User defined cursors on OpenGL windows slowed down NT a *LOT*. Some attempts to fix this by turning off the cursor while drawing the window. Filename completion in the file chooser works better on NT. Typing TAB fixes the case of everything you typed to match the shortest name that can be completed. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1158 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 227879ee7..874c55301 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl.cxx,v 1.24.2.22 2000/05/16 12:26:58 mike Exp $"
+// "$Id: Fl.cxx,v 1.24.2.23 2000/06/03 08:36:59 bill Exp $"
//
// Main event handling code for the Fast Light Tool Kit (FLTK).
//
@@ -360,8 +360,6 @@ void fl_fix_focus() {
if (Fl::grab()) return; // don't do anything while grab is on.
- Fl::e_keysym = 0; // make sure it is not confused with navigation key
-
// set focus based on Fl::modal() and fl_xfocus
Fl_Widget* w = fl_xfocus;
if (w) {
@@ -600,18 +598,35 @@ Fl_Window::~Fl_Window() {
hide();
}
-// Child windows must respond to FL_SHOW and FL_HIDE by actually
-// doing unmap operations. Outer windows assumme FL_SHOW & FL_HIDE
-// are messages from X:
+// FL_SHOW and FL_HIDE are called whenever the visibility of this widget
+// or any parent changes. We must correctly map/unmap the system's window.
+
+// For top-level windows it is assummed the window has already been
+// mapped or unmapped!!! This is because this should only happen when
+// Fl_Window::show() or Fl_Window::hide() is called, or in response to
+// iconize/deiconize events from the system.
int Fl_Window::handle(int event) {
if (parent()) switch (event) {
case FL_SHOW:
if (!shown()) show();
- else XMapWindow(fl_display, fl_xid(this));
+ else XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless
break;
case FL_HIDE:
- if (shown()) XUnmapWindow(fl_display, fl_xid(this));
+ if (shown()) {
+ // Find what really turned invisible, if is was a parent window
+ // we do nothing. We need to avoid unnecessary unmap calls
+ // because they cause the display to blink when the parent is
+ // remapped. However if this or any intermediate non-window
+ // widget has really had hide() called directly on it, we must
+ // unmap because when the parent window is remapped we don't
+ // want to reappear.
+ if (visible()) {
+ Fl_Widget* p = parent(); for (;p->visible();p = p->parent()) {}
+ if (p->type() >= FL_WINDOW) break; // don't do the unmap
+ }
+ XUnmapWindow(fl_display, fl_xid(this));
+ }
break;
}
return Fl_Group::handle(event);
@@ -705,5 +720,5 @@ void Fl_Window::flush() {
}
//
-// End of "$Id: Fl.cxx,v 1.24.2.22 2000/05/16 12:26:58 mike Exp $".
+// End of "$Id: Fl.cxx,v 1.24.2.23 2000/06/03 08:36:59 bill Exp $".
//