07:21 kchibisov: The xdg_toplevel::configure says "If the width or height arguments are zero, it means the client should decide its own window dimension.", does it mean that if I got only one of them zero -> I should pick value myself for that dimension and keep the other one as is?
07:22 kchibisov: The other events, like xdg_toplevel::configure_bounds are using different wording and use **and** instead of **or**.
07:46 ifreund: kchibisov: that seems like the only reasonable thing a client could do there, yes
07:46 kchibisov: Do you mean picking the only one that has 0?
07:47 kchibisov: The other option I have is whether either is zero I pick both width and height myself.
07:50 ifreund: I'd expect the client to only decide the dimension that is zero itself yeah
09:58 maria: Hi friends, I'm having issues setting my EGL application's window size while using server side decorations on KDE's wayland session. Here's a minimal version of the code I'm using: https://github.com/mariakeating/wayland-egl-resize-problem
09:59 maria: Is this a bug or is there some easy logic to ignore the unwanted configure requests while still maintaining the user's ability to resize? Thank you ^^
09:59 maria: Apologies for the terrible phone photo; when trying to take a screenshot of the faulty window it goes back to the default size without any glitches https://i.imgur.com/6Gv5vIf.jpg
10:00 maria: sorry if this is the wrong place to ask for help on this i didn't have any luck on the kde irc channel so if this isn't the right place either i'd appreciate being pointed where to go
10:37 kchibisov: maria: draw in responce to frame events.
10:37 kchibisov: And apply resize from the frame event.
10:41 kchibisov: Though, your logic is weird, you resize the window back to 1280x720, then you don't set geometry for that resize.
10:42 kchibisov: So once in a while you force desync?
10:50 maria: yes sorry the provided code was faulty. in my actual codebase I was setting buffwidth to 1280, bufferheight to 720, and shouldupdategeometry to true while still having the issue.
10:51 maria: i believe i found a solution to the problem by deferring the xdg configure ack to in the loop and also committing the surface
10:52 kchibisov: Well, the solution is to apply configure once per frame event.
10:53 maria: i believe that's achieved in fixed-minimal-egl.c now. i'll have to look into frame events later thank you.
10:55 kchibisov: The code looks wrong, you don't need to commit, you'll commit from the eglSwapBuffers.
10:56 maria: if i don't commit the window glitches out
10:56 kchibisov: So double commit works?
10:56 kchibisov: because right now you commit twice.
10:56 maria: yes
10:57 kchibisov: would, suggest to look into WAYLAND_DEBUG=1 and ask kde folks. But the logic of randomly resetting size and acking configure just looks wrong.
11:02 maria: the goal is to, on user request, resize the window to a set resolution while not fullscreen e.g. in a game menu. here's a video of comparing the double commit to single commit. https://bighatwitch.net/files/691827044.mp4
11:10 kchibisov: How I do, is simply draw with the size I want, set geometry, commit, but I never tested on KDE.
11:11 kchibisov: doing random acks like you do seems weird.
11:11 maria: what do you mean by random acks?
11:13 maria: i ignore all but the lastest by deferring to when i'm drawing the frame i don't think that's random is it?
11:13 kchibisov: If you ack before updating geometry will it change anything?
11:17 maria: same behaviour. here's a recording of the last test but with the ack before geometry update: https://bighatwitch.net/files/3779163135.mp4
11:18 kchibisov: yeah, I don't see anything wrong, would suggest to look into WAYLAND_DEBUG=1 logs.
11:20 kchibisov: Though, I think you ack initial configure twice.
11:20 maria: good catch!
11:23 maria: ahaha fixing that somehow made the behaviour without double commit worse https://bighatwitch.net/files/1688318897.mp4
11:24 kchibisov: I mean, you have an option to validate via logs, if the logs are sane -> KDE bug.
11:29 kchibisov: A good check in your case would be that your buffer dimensions match the geometry you set. You also shouldn't set geometry without buffer attached.
11:33 maria: logs: https://bighatwitch.net/files/587034171.txt video: https://bighatwitch.net/files/2166638785.mp4
11:37 kchibisov: you never set geometry btw.
11:37 kchibisov: Not that it matters though, just saying.
11:37 maria: what does setting geometry mean?
11:38 kchibisov: set_window_geometry.
11:38 emersion: it's fine to never set geometry if you don't need it
11:39 kchibisov: yeah, true.
11:39 kchibisov: Though, some compositors are confused by it...
11:40 emersion: that's a compositor bug then
11:40 kchibisov: But from the logs you've posted you always draw a buffer of 640x480.
11:40 kchibisov: emersion: yeah, there're too many various compositor bugs.
11:40 kchibisov: in addition you have very inconsistent EGL bugs to help you live better.
11:41 kchibisov: as in mesa latches buffers on creation with llvmpipe, but not with dmabufs.
11:42 kchibisov: it's not the case in the posted code, because the surface was created after the size was picked.
11:57 maria: testing it on a nested sway instance the size resets to 640x480 when the mouse leaves the window in all cases both with the double commit, single commit, server side decorations, client side decorations
12:00 kchibisov: sway will just send you a configure with 640x480 once mouse leaves the window.
12:01 maria: i'm okay with not arbitrarily setting the window size but i thought it would be nice for the window to resize to any newly selected resolution in-game. i feel pretty defeated after having it not work at all in sway aha.
12:01 kchibisov: you can simply ignore the size sway tells you.
12:02 maria: is there a simple way to do that while still respecting the user resizing the window?
12:02 kchibisov: You mean with mouse?
12:02 maria: yeah
12:02 kchibisov: The state must be RESIZING for interactive resizes.
12:03 maria: in the wl_array? XDG_TOPLEVEL_STATE_RESIZING?
12:04 kchibisov: Yeah, for the configure event.
12:08 maria: still having weird issues doing that. it doesn't resize when the mouse leaves but if i defloat and refloat after the resize the border and titlebar are for a 640x480 window and go through the actual content.
12:08 maria: https://bighatwitch.net/files/587842246.png
12:09 kchibisov: You should apply the sizes you're being told for TILED/MAXIMIZE.
12:14 maria: https://bighatwitch.net/files/3181307673.png
12:14 kchibisov: Sway resetting size in float is a sway bug though.
12:15 kchibisov: maria: are you sure you're not setting bogus window geometry.
12:15 maria: let me update the github code
12:15 kchibisov: because it seems like the case, I don't have such issue myself when setting the size myself on sway.
12:16 kchibisov: I do have size reset from sway.
12:23 maria: updated the github repo. fixed-egl-minimal is a bit of an awful name at this point. i'm not doing set_window_geometry at all.
12:24 kchibisov: Ah, I got an assumption from minimal, that function called update geometry updates geometry.
12:24 kchibisov: but it's not doing so.
12:24 kchibisov: Yeah, just sway bugged.
12:25 kchibisov: Could try weston.
12:37 maria: doesn't seem weston has client side decorations. works fine both with and without the extra commit though.
13:00 maria: i started testing different applications on kde for some of the other problems i found during this. i'm giving up trying to get everything working perfectly for now and will try again in a few years. thank you for helping me kchibisov i appreciate it a lot.