summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-05-15 09:04:47 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-05-15 09:04:47 +0200
commit6efdcb1e6fa19660de090f04ad50a5402403a947 (patch)
tree8488da9e12f2937490e97d39d48795ad87c95953 /src
parentb6dae138d4422049e87f46d4a0155c6238a0992e (diff)
Simpler code to map GL windows under Wayland.
Diffstat (limited to 'src')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H1
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx17
2 files changed, 8 insertions, 10 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
index 7110a8e3a..8a1c4abc2 100644
--- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.H
@@ -36,7 +36,6 @@ Consequently, FL_DOUBLE is enforced in all Fl_Gl_Window::mode_ values under Wayl
class Fl_Wayland_Gl_Window_Driver : public Fl_Gl_Window_Driver {
friend Fl_Gl_Window_Driver* Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *);
bool egl_resize_in_progress;
- bool swap_done;
Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win);
virtual float pixels_per_unit();
virtual void make_current_before();
diff --git a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
index 67ad43b9e..7cc646ab2 100644
--- a/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Gl_Window_Driver.cxx
@@ -56,7 +56,6 @@ Fl_Wayland_Gl_Window_Driver::Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win) : Fl
egl_window = NULL;
egl_surface = NULL;
egl_resize_in_progress = false;
- swap_done = false;
}
@@ -242,12 +241,13 @@ 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);
- if (pWindow->parent() && Fl_Wayland_Screen_Driver::compositor == Fl_Wayland_Screen_Driver::WESTON) {
- bool done = false;
- struct wl_callback *callback = wl_surface_frame(surface);
- wl_surface_commit(surface);
- wl_callback_add_listener(callback, &gl_surface_frame_listener, &done);
- while (!done) wl_display_dispatch(Fl_Wayland_Screen_Driver::wl_display);
+ bool done = false;
+ struct wl_callback *callback = wl_surface_frame(surface);
+ wl_surface_commit(surface);
+ wl_callback_add_listener(callback, &gl_surface_frame_listener, &done);
+ while (!done) {
+ wl_display_dispatch(Fl_Wayland_Screen_Driver::wl_display);
+ eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
}
}
}
@@ -308,9 +308,8 @@ void Fl_Wayland_Gl_Window_Driver::swap_buffers() {
wl_display_read_events(Fl_Wayland_Screen_Driver::wl_display);
wl_display_dispatch_queue_pending(Fl_Wayland_Screen_Driver::wl_display, gl_event_queue);
}
- if (!egl_resize_in_progress || pWindow->parent() || !swap_done) {
+ if (!egl_resize_in_progress || pWindow->parent()) {
eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
- swap_done = true;
}
egl_resize_in_progress = false;
}