ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput | register your nick to speak
cool110 has quit [Remote host closed the connection]
cool110 has joined #wayland
cool110 has quit [Remote host closed the connection]
<mort_>
does anyone know if weston implements stuff like window hiding and positioning? With a simple SDL application, nothing I do affects the positioning of the window and hiding the window doesn't work, but I don't know if that's SDL's fault or weston's
cool110 has joined #wayland
<mort_>
not even setting the window size has any effect
<mvlad>
mort_, w/ desktop-shell specific positioning won't be possible. desktop-shell will react to set_minimize, but I don't believe there's something to bring it back, so if you minimize it be like that forever. Maximization/fullscreen should work fine. Applications can set their own size, so I suppose that's a SDL issue, if you can't set a specific size.
<mort_>
How about hiding windows?
<mvlad>
s/hiding/minimize.
<mort_>
no, hiding
<mort_>
at least on other systems (macOS, Windows, X11), hiding a window is a different operation from minimizing
jmabr has joined #wayland
<pq>
mort_, Wayland xdg-shell extension for xdg_toplevel says "Attaching a null buffer to a toplevel unmaps the surface." so that's the way to hide, I think.
<pq>
does SDL do that, I don't know
<pq>
mort_, explicit positioning is deliberately not supported on desktop Wayland systems.
<pq>
setting the window size should work fine as long as it's not fullscreen or maximized, so that sounds like something in SDL or your app.
<pq>
would need to inspect a Wayland protocol log to rule out bugs in Weston
<pq>
WAYLAND_DEBUG=1 ./my_app
<kennylevinsen>
(Note that unmap is different from “hiding” in that the compositor cannot unhide: the window is gone until it is remapped.)
<mort_>
oh, that's useful. According to that, SDL_HideWindow() does literally nothing, SDL_ShowWindow() does xdg_toplevel@25.unset_fullscreen(). SDL_MinimizeWindow() and SDL_RestoreWindow() both also do literally nothing
<mort_>
wish it'd just have printed a "this isn't supported with the wayland driver yet" message
<pq>
kennylevinsen, we have unmap and minimize. Is there a case for "hide" that is neither?
<davidre>
iirc Qt just destroys the surface on "hide"
<pq>
yeah, given the xdg-shell spec, there seems to be little difference between destroying and attaching a null buffer.
<pq>
and I think some earlier version of the spec used to forbid attaching null
co1umbarius has joined #wayland
<pq>
my question would be, how to hide without losing the window position
<pq>
or is maintaining that at the compositor's discretion
columbarius has quit [Ping timeout: 480 seconds]
<jadahl>
there is no way to reliably restore a window position when it's remapped (shown after being hidden)
<jadahl>
that's within scope for the xdg_session_manager thingy though
<pq>
ok, so that's the reason to not have a "hide" that would be less destructive than unmap
<pq>
mort_, looks like SDL doesn't implement the xdg-shell top-level mapping sequence quite right.
<pq>
what I'm surprised about is that why does the first re-show operation not fail already
<pq>
luck, I guess
<pq>
there might be something strange in Weston too. I'm not quite sure why the second re-show fails at that point.
<pq>
or maybe it's the spurious attach(null)+commit
<pq>
would need a deeper look
<mort_>
I wish Wayland was more ready
<daniels>
have you filed a bug against SDL?
<mort_>
I didn't know about this bug until just now, and I don't know that it's in SDL rather than weston
<mort_>
they'll just ask me to try with the latest sdl version and I don't think I have the patience to do that right now, I'll just try to work around this
<pq>
SDL is definitely not doing everything right there
<mort_>
hiding the window doesn't even work
<mort_>
it's not just that the second showwindow doesn't work
<pq>
not hiding may be a weston bug
MajorBiscuit has quit [Ping timeout: 480 seconds]
<pq>
SDL is not listening for the configure events it must listed for when mapping a top-level
<mort_>
maybe I should just go back to X
<pq>
*listen for
devilhorns has joined #wayland
<pq>
mort_, anyway, nothing will get better, if there are no open bug reports about these. IRC does not count.
rasterman- has quit [Read error: No route to host]
<pq>
mort_, thanks!
anarsoul|2 has quit [Ping timeout: 480 seconds]
anarsoul has joined #wayland
<mort_>
I wish wayland was just production ready though
<mort_>
the compositors are probably largely solid but the ecosystem is... not
<pq>
mort_, I'm not sure it's ok to use sleep() like that, do you not need to SDL_PollEvent() in the mean time to let SDL react to Wayland events?
rasterman has joined #wayland
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<pq>
or maybe SDL uses a background thread to handle Wayland?
<pq>
mort_, also seeing that you use Mali, are you also using a Mali-hacked-up version of Weston?
rasterman has quit []
<mort_>
afaik you should be able to do whatever you want with your application's main thread with SDL, and the PollEvent mechanism is only to deliver events from SDL to your application
rasterman has joined #wayland
<pq>
alright
<mort_>
just in case though I tried to replace the sleep with SDL_Delay (which *has* to be okay, right?) and I even tried inserting the pollevent loop inbetween every SDL call
<mort_>
didn't change anything
<pq>
ok
<mort_>
we are indeed using a mali hacked-up version of weston
<pq>
I wonder if the Mali-hacks somehow break HideWindow... always easy to blame foreign code
caveman has joined #wayland
<mort_>
I don't even understand why there has to be anything mali-specific in weston
eroux has joined #wayland
al has quit [Ping timeout: 480 seconds]
al has joined #wayland
<kennylevinsen>
I wish SDL had a proper event poll. SDL_PollEvent is a busy poll with a 1ms sleep... :(
<daniels>
oh my god
<mort_>
SDL_PollEvent is non-blocking isn't it?
<daniels>
mort_: there doesn't have to be anything mali-specific in weston, it works perfectly well on mali out of the box
<mort_>
do you mean SDL_WaitEvent
<daniels>
Rockchip have hacked the bejesus out of it in order to make a bunch of their hacked-up proprietary stack (which doesn't use standard protocols or anything sensible) work
<mort_>
fun
<daniels>
the hacked-up NXP version is worse in terms of code quality for sure, but the things Rockchip do in that tree are absolutely astonishing
<daniels>
I really admire their creativity, but it's also really horrible
<daniels>
I would definitely try to use mainline things first, rather than outdated forks which have been hacked to hell and back by the vendor
<mort_>
this isn't the area where I want "creativity" tbh
<any1>
The only issue with this is that you could blow up your stack if you're not careful :)
txtsd has quit [Ping timeout: 480 seconds]
<mort_>
if SDL_Delay is just a sleep, that means sleeping in the main thread is explicitly supported
Company has joined #wayland
txtsd has joined #wayland
<kennylevinsen>
it's either a nanosleep or a select with a timeout but no fds (?!), but a sleep regardless
<pq>
that select() thing is probably the most portable way to sleep sub-second intervals
<pq>
if you care about very... exotic... systems
<mort_>
SDL is from 1998
<mort_>
it might've been reasonable back then to support unices without usleep or nanosleep and then it just never got removed, idk
floof58 has quit [Ping timeout: 480 seconds]
eroux has joined #wayland
maxzor has quit [Ping timeout: 480 seconds]
<mort_>
does weston support alpha transparency?
<pq>
mort_, you mean alpha channel in windows? Yes.
<mort_>
then SDL is somehow not drawing transparency when it should
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tleydxdy has joined #wayland
tleydxdy has quit []
lsd|2 has joined #wayland
maxzor has joined #wayland
caveman has quit [Ping timeout: 480 seconds]
lsd|2 has quit [Remote host closed the connection]
<mort_>
alright, so SDL isn't gonna work with me but I need to hide a window. I have the wl_display*, wl_surface* and wl_shell_surface*. What would be the best way to hide the window without any help from SDL? I'm thinking it might be to draw transparent pixels to the surface window, but I don't know what the cleanest way to do that would be
doppo has quit [Remote host closed the connection]
<mort_>
s/surface window/window surface/
rektide has quit [Remote host closed the connection]
Dami-star has quit []
Dami_Lu has joined #wayland
cvmn has quit [Remote host closed the connection]
cvmn has joined #wayland
doppo has joined #wayland
<any1>
Maybe SDL is using X11?
rektide has joined #wayland
<mort_>
it's not
<mort_>
I don't even think this system has XWayland, and SDL_GetWindowWMInfo reports wayland
<kennylevinsen>
Hmm. If you have a wl_shell_surface from sdl then you have an old version of SDL (xdg shell was added in 2018, HideWindow was implemented in 2021). A total hack would be to submit a 1px alpha buffer, but that'll give worse UX than just minimizing the window...
<mort_>
minimizing doesn't work either
<mort_>
submitting a 1px alpha buffer is perfectly ok, this is a system which nobody is interacting with through a keyboard/mouse
<kennylevinsen>
You can use a 0 input region to avoid any input
<mort_>
ah no, the showWindow source code starts with a "Detach any previous buffers before resetting everything" comment, so that's probably what is meant
<kennylevinsen>
... before the first commit when configuring the surface role.
<mort_>
aha. So completely unrelated then probably
<mort_>
but in SDL_ShowWindow, the xdg surface isn't configured yet, hence the crash, right
c7s has joined #wayland
floof58 has joined #wayland
tleydxdy[m] has quit []
tleydxdy[m] has joined #wayland
tleydxdy[m] has quit []
floof58 has quit [Quit: floof58]
floof58 has joined #wayland
eroux has joined #wayland
<kennylevinsen>
yeah to attach a buffer, you must first have committed the role, and you must ack the configure that comes (although we allow the ack to be in the same commit as the attached buffer in wlroots - I assume that's fine). After an unmap you can reuse your role if it still exists, but you still need to commit to get a configure/ack in place.
tleydxdy has joined #wayland
<tleydxdy>
Hi everyone, I was trying to run vkcube-wayland and it would segfault because my compositor doesn't have a seat/keyboard/etc so it would try to free the NULL pointer when it exits. would it be a good idea to add a null check into wl_proxy_destroy so applications don't need to check for null? similar to how normally free() works
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eroux has joined #wayland
eroux has quit []
zebrag has joined #wayland
Narrat has joined #wayland
___nick___ has joined #wayland
___nick___ has quit []
___nick___ has joined #wayland
bittin has quit [Remote host closed the connection]
MajorBiscuit has quit [Ping timeout: 480 seconds]
rgallaispou has quit [Ping timeout: 480 seconds]
jmdaemon has joined #wayland
qyliss has quit [Quit: bye]
qyliss has joined #wayland
tzimmermann has quit [Quit: Leaving]
___nick___ has quit []
___nick___ has joined #wayland
___nick___ has quit []
___nick___ has joined #wayland
devilhorns has quit []
erle- has quit []
___nick___ has quit []
___nick___ has joined #wayland
ppascher has quit [Ping timeout: 480 seconds]
fmuellner_ has joined #wayland
fmuellner has quit [Ping timeout: 480 seconds]
co1umbarius has joined #wayland
columbarius has quit [Ping timeout: 480 seconds]
fmuellner_ has quit [Ping timeout: 480 seconds]
maxzor has quit [Remote host closed the connection]
maxzor has joined #wayland
ppascher has joined #wayland
jgrulich has quit [Remote host closed the connection]
danvet has quit [Ping timeout: 480 seconds]
rasterman has quit [Quit: Gettin' stinky!]
___nick___ has quit [Ping timeout: 480 seconds]
soreau has quit [Quit: Leaving]
soreau has joined #wayland
maxzor has quit []
Seirdy has joined #wayland
mvlad has quit [Remote host closed the connection]
Narrat has quit []
fmuellner has joined #wayland
mclasen has quit []
mclasen has joined #wayland
mclasen has quit []
mclasen has joined #wayland
jmabr has quit [Quit: Leaving]
hergertme has quit [Remote host closed the connection]
hergertme has joined #wayland
mclasen has quit []
mclasen has joined #wayland
rv1sr has quit []
mclasen has quit []
mclasen has joined #wayland
dcz_ has quit [Ping timeout: 480 seconds]
AJ_Z0 has quit [Quit: I have to return some videotapes]