EGL surface positioning with Wayland

107 Views Asked by At

I'm having some trouble developing an OpenGL based application running on Wayland.. The issue is in how the EGL display is positioned within the toplevel window, particularly in the presence of client-side decorations.

I've tried two approaches:

  1. Drawing the client-side decorations around the outside of the toplevel window. This means I can use the entirety of the toplevel surface for drawing, and all appears well. Unfortunately, this seems to have the side effect of growing the boundary of my toplevel surface, with undesirable consequences (subsequent configure events include the dimensions of the decorators, something that proved tricky to handle in a sane/consistent way across window managers with resize events).

  2. Drawing the client-side decorations on the inside edge of the toplevel window. With no further modification, this means the decorations are obscuring the edges of the EGL display

Focussing on the second scenario, I've been trying to find a way to draw the EGL display within the dimensions of the client-side decorations (eg: constrained to some smaller viewport within the toplevel window, to no avail..

I've additionally tried creating a subsurface, and calling wl_egl_create_display() against that subsurface... but for reasons yet unknown, this prevents any kind of window begin created at all (ping/pong events occur, that's about it).

At this point, I'm tempted to go back to the first scenario and try to make it work.. it's proving to be very frustrating.

I guess I want to know...

  • Is there a best practice regarding the creation of client-side decorations, given the two approaches presented?
  • Is it possible to create an EGL display against a wayland subsurface rather than directly against a toplevel surface?
0

There are 0 best solutions below