diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-03-15 06:42:06 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-08-29 12:15:32 +0200 |
| commit | c720aae51515907ae82ee02df80bd084f291d4b1 (patch) | |
| tree | 7fbf3569f35966891df68490b047b30c9ec20bcd /src/Fl_Window_Driver.cxx | |
| parent | 28981f6fd3971aaf7ff6527ee1cdeb9d886c4a4a (diff) | |
Make hybrid Wayland/X11 platform.
Diffstat (limited to 'src/Fl_Window_Driver.cxx')
| -rw-r--r-- | src/Fl_Window_Driver.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx index 23c66be7f..a9faa3211 100644 --- a/src/Fl_Window_Driver.cxx +++ b/src/Fl_Window_Driver.cxx @@ -258,6 +258,32 @@ void Fl_Window_Driver::menu_window_area(int &X, int &Y, int &W, int &H, int nscr scr_driver->screen_work_area(X, Y, W, H, nscreen); } +/** Returns the platform-specific reference of the given window, or NULL if that window isn't shown. + \version 1.4.0 */ +fl_uintptr_t Fl_Window_Driver::xid(const Fl_Window *win) { + Fl_X *flx = win->i; + return flx ? flx->xid : 0; +} + +/** Returns a pointer to the Fl_Window corresponding to the platform-specific reference \p xid of a shown window. + \version 1.4.0 */ +Fl_Window *Fl_Window_Driver::find(fl_uintptr_t xid) { + Fl_X *window; + for (Fl_X **pp = &Fl_X::first; (window = *pp); pp = &window->next) { + if (window->xid == xid) { + if (window != Fl_X::first && !Fl::modal()) { + // make this window be first to speed up searches + // this is not done if modal is true to avoid messing up modal stack + *pp = window->next; + window->next = Fl_X::first; + Fl_X::first = window; + } + return window->w; + } + } + return 0; +} + /** \} \endcond |
