FLTK logo

Re: [fltk.coredev] Windows 11 crash (still investigating)

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 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Windows 11 crash (still investigating) "'Albrecht Schlosser' via fltk.coredev" 12:38 Apr 29  
  On 4/29/24 11:14 Gonzalo Garramulo wrote:

El 28/4/24 a las 19:45, 'Albrecht Schlosser' via fltk.coredev escribió:

Summary:
(1) You should fix your program (see above) and ...

See this new version of the program that no longer crashes:

https://mega.nz/file/aHYWkabR#EUFPKmDA_87NSLKekWjH8fHb4kmpaKz8kht_KjNsyZc

To avoid the crashes besides your suggestions I cleaned up the code and added clamping of the thumbnail subwindow to the parent windows' borders.

Yeah, looks good (much better than before) - but unfortunately it doesn't work on Wayland (as expected). The problem of Wayland is that you can't position windows absolutely on the screen and you don't get real (screen) coordinates of windows and events.

Good news: an even simplified version works fine on all current FLTK platforms. See attached file 'timeline.diff'.

Note to Gonzalo and others: subwindows don't have borders anyway, hence 'clear_border();' could be removed.

Although this particular solution of a user's issue is going OT now I decided to post my solution here for others seeing this later. The attached file 'timeline2.cxx' demonstrates how a /subwindow/ (called 'thumbnailWindow') can be opened (shown) and moved above the main window while moving (or dragging) the mouse. Thanks to Gonzalo for the working example, BTW.. The point here is that 'thumbnailWindow' is a subwindow and not another independent window which can't be positioned easily on Wayland (we have a working solution for menus etc. but there's no API for user programs).

The mechanism used in this example is that the subwindow is the last child of the main window (thus always drawn on top). It overlaps other widgets of the main window but this is tolerable in this case.

The code in
```
    thumbnailWindow->parent()->redraw(); // needed for Wayland
```
is not optimal because it may draw more than needed but I'm leaving this as an exercise for the reader.

(2) I will fix the potential NULL pointer dereference.

Yes, do so just in case, as it is still a bug.   Thanks!

Welcome, and done in commit b402b6a8397f9fc13157813d39d505ea9ead00f0.

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/408be7ea-3e07-4878-b1b3-6317de6231a6%40aljus.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

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'.