View Bug Details

IDProjectCategoryView StatusLast Update
0002121DCP-o-maticBugspublic2023-09-01 21:50
Reportercarl Assigned Tocarl  
PriorityimmediateSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.16.0 
Summary0002121: GL viewer broken on Wayland
Description

Needs an update of wxWidgets higher than 3.1.4 (3.1.5 works) to start without crashing, then when it does the sizing/position is messed up (perhaps the same as what Carsten is seeing?)

This is on the 4K laptop so it may also be a HiDPI thing.

TagsNo tags attached.
Branch
Estimated weeks required
Estimated work requiredUndecided

Relationships

related to 0002118 closedcarl DCPs not scaled up to 5K screen in OpenGL mode on macOS 

Activities

carl

2021-11-11 19:50

administrator   ~0004639

The position is (slightly) broken on wayland/2K but the sizing is OK. So it looks like the positioning is wayland-related and the size is hidpi-related.

carl

2021-11-11 21:25

administrator   ~0004641

A workaround for the wayland positioning errors is to use GDK_BACKEND=x11 - see https://trac.wxwidgets.org/ticket/17702

carl

2021-11-11 23:32

administrator   ~0004643

cah@client1455:~/src/wxWidgets$ git diff
diff --git a/include/wx/unix/glegl.h b/include/wx/unix/glegl.h
index ccdd302e36..cbe3ffaf9d 100644
--- a/include/wx/unix/glegl.h
+++ b/include/wx/unix/glegl.h
@@ -122,6 +122,7 @@ public:
     wl_subcompositor *m_wlSubcompositor;
     wl_callback *m_wlFrameCallbackHandler;
     wl_egl_window *m_wlEGLWindow;
+    wl_subsurface *m_wlSubsurface;

 private:

@@ -132,7 +133,6 @@ private:
     unsigned long m_xwindow;
     wl_surface *m_wlSurface;
     wl_region *m_wlRegion;
-    wl_subsurface *m_wlSubsurface;

     // the global/default versions of the above
     static EGLConfig *ms_glEGLConfig;
diff --git a/src/unix/glegl.cpp b/src/unix/glegl.cpp
index fa4ad29b51..4930ee2960 100644
--- a/src/unix/glegl.cpp
+++ b/src/unix/glegl.cpp
@@ -444,6 +444,9 @@ static void gtk_glcanvas_size_callback(GtkWidget *widget,
     int scale = gtk_widget_get_scale_factor(widget);
     wl_egl_window_resize(win->m_wlEGLWindow, win->m_width * scale,
                          win->m_height * scale, 0, 0);
+    int x, y;
+    gdk_window_get_origin(win->GTKGetDrawingWindow(), &x, &y);
+    wl_subsurface_set_position(win->m_wlSubsurface, x, y);
 }

 } // extern "C"

carl

2021-11-11 23:33

administrator   ~0004644

Seems to help - bit of a hack though, especially setting up the position in response to a size callback. I tried to listen to configure-event but it never seemed to show up.

carl

2021-11-12 00:00

administrator   ~0004645

Added that patch to b73b43da73aeddf2ca0875a8a55022cf2f698622 in dcpomatic-infrastructure

carl

2021-11-12 00:04

administrator   ~0004646

Last edited: 2021-11-12 00:04

ubuntu-16.04-64
centos-7-64
ubuntu-21.04-64
debian-10-64
mageia-8-64
fedora-33-64
fedora-34-64
debian-unstable-64
ubuntu-18.04-64/
ubuntu-21.10-64/
debian-9-64/
debian-11-64/
/ubuntu-20.04-64/
ubuntu-16.04-32/
centos-8-64

Bug History

Date Modified Username Field Change
2021-11-11 11:40 carl New Bug
2021-11-11 11:40 carl Relationship added related to 0002118
2021-11-11 19:50 carl Note Added: 0004639
2021-11-11 20:35 carl Description Updated
2021-11-11 20:35 carl Estimated work required => Undecided
2021-11-11 21:25 carl Note Added: 0004641
2021-11-11 21:25 carl Assigned To => carl
2021-11-11 21:25 carl Status new => confirmed
2021-11-11 23:32 carl Note Added: 0004643
2021-11-11 23:33 carl Note Added: 0004644
2021-11-12 00:00 carl Note Added: 0004645
2021-11-12 00:04 carl Note Added: 0004646
2021-11-12 00:04 carl Note Edited: 0004646
2021-11-13 23:30 carl Status confirmed => feedback
2021-11-22 12:25 carl Status feedback => resolved
2021-11-22 12:25 carl Resolution open => fixed
2023-09-01 21:50 carl Status resolved => closed