CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2026-01-05
by Albrecht Schlosser

Original Post

Original - Posted on 2026-01-05
by Albrecht Schlosser



            
Present in both answers; Present only in the new answer; Present only in the old answer;

I suggest to take a look at the FLTK documentation chapter "[Operating System Issues](https://www.fltk.org/doc-1.4/osissues.html)", section ["The Wayland Interface"](https://www.fltk.org/doc-1.4/osissues.html#osissues_wayland). There you can find that the correct and easy answer is to use `fl_wl_gc()` to retrieve the Cairo context of a window in the "hybrid" FLTK library running on Linux with Cairo as the drawing backend. I'm not sure though if there's an issue with your own derived popup class.
A working example program can be found here: <https://groups.google.com/g/fltkgeneral/c/-%5C_dI2Ek8E_k/m/eTgoD7njAAAJ> . This code works (tested by me today) under FLTK 1.4 and 1.5 (Git) and - slightly surprising - with both the Wayland and the X11 (XWayland) backend.
As regards popup positioning under Wayland: this is a problem because Wayland hides window coordinates and doesn't allow to position windows on the screen. The FLTK menu positioning code is hidden deep inside the library and doesn't have public access. Currently you would likely need to write your own Wayland specific code to position your popup which sounds bad and hardly doable.
It would be interesting to publish a user callable interface for positioning popup windows, but AFAICT this doesn't exist yet. You could go to our [GitHub Discussions page (Q&A)](https://github.com/fltk/fltk/discussions/categories/q-a) and propose to add such an interface or ask how to do it. Our Wayland specialist is known to watch the discussions (I'm one of the core FLTK developers).
Note: I didn't try to build the stripped down version of your software. It would be much better if you could post a self-contained, complete example source file that shows the issue.
I suggest to take a look at the FLTK documentation chapter "[Operating System Issues](https://www.fltk.org/doc-1.4/osissues.html)", section ["The Wayland Interface"](https://www.fltk.org/doc-1.4/osissues.html#osissues_wayland). There you can find that the correct and easy answer is to use `fl_wl_gc()` to retrieve the Cairo context of a window in the "hybrid" FLTK library running on Linux with Cairo as the drawing backend. I'm not sure though if there's an issue with your own derived popup class.
A working example program can be found here: <https://groups.google.com/g/fltkgeneral/c/-%5C_dI2Ek8E_k/m/eTgoD7njAAAJ> . This code works (tested by me today) under FLTK 1.4 and 1.5 (Git) and - slightly surprising - with both the Wayland and the X11 (XWayland) backend.
As regards popup positioning under Wayland: this is a problem because Wayland hides window coordinates and doesn't allow to position windows on the screen. The FLTK menu positioning code is hidden deep inside the library and doesn't have public access. Currently you would likely need to write your own Wayland specific code to position your popup which sounds bad and hardly doable.
It would be interesting to publish a user callable interface for positioning popup windows, but AFAICT this doesn't exist yet. You could go to our [GitHub Discussions page (Q&A)](https://github.com/fltk/fltk/discussions/categories/q-a) and propose to add such an interface or ask how to do it. Our Wayland specialist is known to watch the discussions (I'm one of the core FLTK developers).
Note: I didn't try to build the stripped down version of your software. It would be much better if you could post a self-contained, complete example source file that shows the issue.

        
Present in both answers; Present only in the new answer; Present only in the old answer;