|
commit 7fcd4b73d700d04b2bb6a758bd542c324a6e2aed
Author: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Wed May 25 18:37:43 2022 +0200
Commit: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Wed May 25 18:37:43 2022 +0200
Wayland platform: more accurate procedure to map a GL (sub)window.
src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx | 19 ++++++++++---------
src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 4 ++--
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index 66183d6..ab1b379 100644
--- src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -231,16 +231,17 @@ void Fl_Wayland_Gl_Window_Driver::make_current_before() {
egl_surface = eglCreateWindowSurface(egl_display, g->egl_conf, egl_window, NULL);
//fprintf(stderr, "Created egl surface=%p at scale=%d\n", egl_surface, win->scale);
wl_surface_set_buffer_scale(surface, win->scale);
- // Tested apps: shape, glpuzzle, cube, fractals, gl_overlay, fullscreen,
- // OpenGL3-glut-test, OpenGL3test
- // Tested wayland compositors: mutter, kde-plasma, weston, sway on FreeBSD
- // Origin of the value 3 below :
- // All tests run OK with value 3 whereas some tests fail with 2, e.g.,
- // glpuzzle + KDE, glpuzzle + sway sometimes.
- for (int count = 0; count < 3; count++) {
- wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display);
- eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
+ // Tested apps: shape, glpuzzle, cube, fractals, gl_overlay, fullscreen, unittests,
+ // OpenGL3-glut-test, OpenGL3test.
+ // Tested wayland compositors: mutter, kde-plasma, weston, sway on FreeBSD.
+ // Origin of the 3 "roundtrips" below :
+ // All tests run OK with code below but glpuzzle, OpenGL3-glut-test and gl_overlay
+ // fail sometimes under KDE and sway without the 3rd roundtrip.
+ wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display);
+ wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display);
+ if (!pWindow->parent() || overlay()) { wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display);
}
+ eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
}
}
diff --git src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index e7622d6..4a1cd1b 100644
--- src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1090,9 +1090,9 @@ void Fl_Wayland_Screen_Driver::open_display_platform() {
if (!has_xrgb) {
Fl::fatal("Error: no WL_SHM_FORMAT_ARGB8888 shm format\n");
}
- if (compositor == Fl_Wayland_Screen_Driver::unspecified) {
+ /*if (compositor == Fl_Wayland_Screen_Driver::unspecified) {
Fl::warning("FLTK could not identify the type of the running Wayland compositor");
- }
+ }*/
Fl::add_fd(wl_display_get_fd(wl_display), FL_READ, (Fl_FD_Handler)fd_callback, wl_display);
fl_create_print_window();
}
[ Direct Link to Message ] | |