Wayland: remove un-necessary Fl_Wayland_Gl_Window_Driver::gl_event_queue

This commit is contained in:
ManoloFLTK 2022-12-28 08:55:02 +01:00
parent 86adfe0dbe
commit bb96cfac44
2 changed files with 5 additions and 9 deletions

View File

@ -55,7 +55,6 @@ class Fl_Wayland_Gl_Window_Driver : public Fl_Gl_Window_Driver {
char *alpha_mask_for_string(const char *str, int n, int w, int h, Fl_Fontsize fs);
static EGLDisplay egl_display;
static EGLint configs_count;
static struct wl_event_queue *gl_event_queue;
void init();
struct wl_egl_window *egl_window;
EGLSurface egl_surface;

View File

@ -65,7 +65,6 @@ static EGLConfig wld_egl_conf = NULL;
EGLDisplay Fl_Wayland_Gl_Window_Driver::egl_display = EGL_NO_DISPLAY;
EGLint Fl_Wayland_Gl_Window_Driver::configs_count = 0;
struct wl_event_queue *Fl_Wayland_Gl_Window_Driver::gl_event_queue = NULL;
Fl_Wayland_Gl_Window_Driver::Fl_Wayland_Gl_Window_Driver(Fl_Gl_Window *win) : Fl_Gl_Window_Driver(win) {
@ -102,8 +101,6 @@ void Fl_Wayland_Gl_Window_Driver::init() {
eglGetConfigs(egl_display, NULL, 0, &configs_count);
//printf("EGL has %d configs\n", configs_count);
eglBindAPI(EGL_OPENGL_API);
gl_event_queue = wl_display_create_queue(fl_wl_display());
}
@ -360,12 +357,12 @@ void Fl_Wayland_Gl_Window_Driver::swap_buffers() {
if (egl_surface && !egl_swap_in_progress) {
egl_swap_in_progress = true;
//eglSwapInterval(egl_display, 0); // doesn't seem to have any effect in this context
while (wl_display_prepare_read(fl_wl_display()) != 0) {
wl_display_dispatch_pending(fl_wl_display());
while (wl_display_prepare_read(Fl_Wayland_Screen_Driver::wl_display) != 0) {
wl_display_dispatch_pending(Fl_Wayland_Screen_Driver::wl_display);
}
wl_display_read_events(fl_wl_display());
wl_display_dispatch_queue_pending(fl_wl_display(), gl_event_queue);
wl_display_flush(Fl_Wayland_Screen_Driver::wl_display);
wl_display_read_events(Fl_Wayland_Screen_Driver::wl_display);
wl_display_dispatch_pending(Fl_Wayland_Screen_Driver::wl_display);
eglSwapBuffers(Fl_Wayland_Gl_Window_Driver::egl_display, egl_surface);
egl_swap_in_progress = false;
}