FLTK logo

STR #22

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.1 | SVN ⇄ GIT ]

STR #22

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:4 - High, e.g. key functionality not working
Scope:2 - Specific to an operating system
Subsystem:MacOS
Summary:Mac OSX hide sub Fl_Window hides system window.
Version:1.1.3
Created By:rsmith.ncbi.nlm.nih
Assigned To:mike
Fix Version:1.1.4
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 rsmith.ncbi.nlm.nih
13:23 Apr 28, 2003
Mac OSX (tested on 10.1.5 and 10.2.5 with Apple dev tools (GCC) and Codewarrior 8.3).

If a desktop Fl_Window contains a Fl_Group which contains another Fl_Window, when you hide() the Fl_Group, the desktop window disappears.

The problem is in Fl_Window::handle() (Fl.cxx) when called from Fl_Group::handle() with a FL_HIDE event.  Since the sub-window has shown()==true, Fl_Window::handle() calls XUnmapWindow() for the parent window (why??), which on Mac is simply the Apple routine: HideWindow().

The comment above Fl_Window::handle() says that:

"this should only happen when Fl_Window::show() or Fl_Window::hide() is called, or in response to iconize/deiconize events from the system"

But in this case none of these pre-requisites are true.

We first saw this when we put a Fl_Window (particularly a Fl_Gl_Window) in a Fl_Tabs.  When switching tabs the whole window disappears.

We have tested this on other operating systems and not seen this problem.

Robert Smith
(working with Vlad Lebedev)
 
 
#2 rsmith.ncbi.nlm.nih
09:47 May 06, 2003
The following change to Fl_Window::handle() seems to fix the problem. Basically instead of calling XUnmapWindow for subwindows being hidden as a result of their parent Group (not a Fl_Window) being hidden, instead we do the same thing that a Fl_Window does for its sub-Windows when it is hidden:
call hide() for them, than set their visible flag back on.

file: Fl.cxx line: 812

int Fl_Window::handle(int ev)
{
  if (parent()) {
    switch (ev) {
    case FL_SHOW:
      if (!shown()) show();
      else XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless
      break;
    case FL_HIDE:
      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
        }
#ifdef __APPLE__
        hide();
        set_visible();
#else
        XUnmapWindow(fl_display, fl_xid(this));
#endif
      }
      break;
    }
//  } else if (ev == FL_FOCUS || ev == FL_UNFOCUS) {
//    Fl_Tooltip::exit(Fl_Tooltip::current());
  }

  return Fl_Group::handle(ev);
}

 
 
#3 mike
08:16 May 20, 2003
Works for me - commited to CVS for 1.1.4.  
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.