06:35outfoxxed: Hello, I'm having some issues with xdg_positioner. Using the top_right anchor with bottom_right gravity and flip_xy constraints, I assume the popup should point towards bottom_left and start at top_left however it is weirdly offset to the left in every compositor. Anything I could be doing wrong?
06:36outfoxxed: *when flipping due to a screen border to the right
06:37outfoxxed: Specifically the wayland requests are - set_anchor_rect(1030, 28, 1, 1), set_anchor(7), set_gravity(8), set_size(235, 263), set_constraint_adjustment(12)
06:40outfoxxed: same also happens with the bottom_right edge (set_anchor(8))
06:42outfoxxed: I have no idea why its broken as gtk positions popups with the exact same anchors and gravity, but with every constraint flag set (which also doesn't work when I try it), and it works fine
06:42vyivel: "I assume the popup should [...] start at top_left" - don't you want set_anchor(5) then?
06:42outfoxxed: typo, sorry
06:43outfoxxed: lets just go with bottom_right, so 8, for consistency with what gtk does
06:43outfoxxed: it behaves the same
06:45outfoxxed: actually no, misread - what I mean is I assume the opposite anchor would be picked when flipping
06:45vyivel: hm not sure if anchor matters at all if the anchor rect is 1x1 in size
06:46vyivel: so, with bottom_right gravity the anchor point would the top left corner of the popup
06:47outfoxxed: anchor does seem to matter, even when sized 1x1
06:47outfoxxed: sway no longer flips it and just pushes it if i set it to top_left instead of bottom_right
06:48vyivel: ah right anchor matters for constraint adjustment
06:49outfoxxed: let me get a picture of this, got a good site to dump images? I don't have anything set up as I don't normally use irc.
06:49vyivel: also gtk3 sets anchor 8 and gtk4 sets anchor 6 (tested with demo apps)
06:49outfoxxed: I'm testing against waybar
06:49outfoxxed: so gtk3
06:50vyivel: you can upload to something like https://litterbox.catbox.moe/ maybe
06:50outfoxxed: thanks
06:51outfoxxed: https://litter.catbox.moe/hpaibt.png
06:52outfoxxed: this should be flipping on the keyboard icon
06:52outfoxxed: looks like this when it doesn't flip
06:52outfoxxed: https://litter.catbox.moe/6e7o41.png
06:57outfoxxed: any additional information I could provide that might shed some light on it, or any non wlroots compositors that support layer shell I can test it with?
06:58vyivel: kwin supports layer-shell iirc
06:58vyivel: also hyprland technically but i think they just copied whatever wlroots had
06:59outfoxxed: the hyprland impl is broken, but differently
06:59outfoxxed: is it possible to install just kwin without all of kde
07:00vyivel: depends on how you distro packages it
07:00outfoxxed: oh nice it just launched nested
07:00outfoxxed: was not expecting it to be that easy
07:01outfoxxed: kwin does the same thing
07:02vyivel: i have replicated the setup in wlr-clients' layer-shell and it works as i'd expect (no offset, correct flip)
07:03outfoxxed: would you mind helping me look at this WAYLAND_DEBUG log to see if its doing anything odd? from what I can tell everything looks correct as its positioning a surface and creating it all with the right sizes and flags
07:03vyivel: sure
07:05outfoxxed: https://pastebin.com/ZZQPEZAp
07:06outfoxxed: I'll grab a similar one for waybar
07:08vyivel: that one looks correct
07:09outfoxxed: sec waybar is opening a tooltip or something, making sure I get the right part of the log
07:10outfoxxed: waybar https://pastebin.com/Xb7NBpbJ
07:10outfoxxed: sends all the surface updates immediately so I included them
07:12outfoxxed: looks like this for context https://litter.catbox.moe/xnymrb.png
07:13vyivel: the offset comes from xdg_surface.set_window_geometry(24, 21, …)
07:14outfoxxed: the thing is its not waybar thats offset
07:14outfoxxed: its mine, and that sets the window geometry only once to the actual geometry
07:15outfoxxed: maybe waybar's come from some kind of shadow CSD?
07:15outfoxxed: yeah i see a shadow
07:15outfoxxed: but that shouldn't affect the position of the popup
07:16vyivel: wait actually
07:16vyivel: the last screenshot you sent seems correct
07:16outfoxxed: yes thats waybar
07:16outfoxxed: it looks right everywhere
07:18vyivel: nvm i misunderstood you
07:20vyivel: it would be easier if i could just run the program myself
07:20outfoxxed: i can link it, sec
07:20outfoxxed: https://git.outfoxxed.me/outfoxxed/quickshell
07:21outfoxxed: requires config, uploading the one I'm working on
07:23outfoxxed: https://litter.catbox.moe/iyusd6.gz config, extract it and run with `quickshell -p path/to/shell.qml`
07:27outfoxxed: thats a tar.gz btw, stripped the .tar
07:28vyivel:is waiting for quickshell to finish building
07:31outfoxxed: forgot the uncommitted changed which modify the anchors, but it has the same effect with or without. can send the patch if you want to test that too
07:32outfoxxed: this should incremental compile on top of the rest fine https://litter.catbox.moe/gjbsk7.patch
07:38vyivel: hm, no keyboard module in the config(?)
07:38outfoxxed: thats Fcitx, its part of the system tray
07:38vyivel: ah
07:39outfoxxed: same happens with any tray popup though
07:43soreau: It seems like it could be the shadow area? does waybar popups have shadows?
07:43soreau: do*
07:43outfoxxed: the waybar popup appears to. qt's should not
07:43outfoxxed: (maybe it might depending on QPA)
07:43outfoxxed: can you reproduce the issue at least?
07:43soreau: well maybe gtk layer shell handles the offset?
07:44outfoxxed: there shouldn't be an offset without setting one though
07:44soreau: there is if there's a shadow area, I'd think
07:44outfoxxed: there is in waybar yes
07:45soreau: is there a way to disable the shadows for the tooltip to test it?
07:45outfoxxed: I'm not sure, I think that would be up to gtk
07:45soreau: like set_decorated(bool) in gtk
07:45soreau: but I thought quickshell was qt?
07:45outfoxxed: yeah, there is no shadow for the qt menu
07:46outfoxxed: no offset either
07:46outfoxxed: waybar which is gtk has a shadow and offset
07:46soreau: so you have a menu that is also a popup but it is shadowless?
07:46soreau: and the popups with the issue have shadows?
07:47outfoxxed: no. My popup gets offset oddly to the left when flipping, and has no shadow or offset. waybar's popup looks fine and has a shadow and offset
07:47outfoxxed: this was tested on sway, wayfire, kwin and hyprland
07:48outfoxxed: hyprland's impl is generally broken so I haven't taken the anchors that do do what I want at face value, as they work nowhere else
07:48soreau: I'm surprised people dare to run that software :P
07:50soreau: ech, cmake
07:51soreau: probably should add you a meson build system for your own sanity's sake
07:51outfoxxed: tbh every time I've looked at meson it seemed like more of a pain in the ass than cmake
07:51soreau: nope
07:51soreau: you'd be wrong
07:51soreau: :-)
07:51soreau: but that's a topic for another channel..
07:52soreau: hopefully vyivel can figure out what's going wrong
07:52soreau: it's either client or wlroots bug
07:52outfoxxed: it happens in kwin and hyprland as well, so if it is wlroots its a bug everyone else copied
07:53vyivel: i wrote wlroots' xdg-positioner impl from scratch and kwin has its own too
07:53soreau: ah, in that case the bug isn't in wlroots
07:53soreau: vyivel's code is naturally bugless xD
07:54vyivel: i wish that was the case
07:55outfoxxed: I'd try just adding an offet to quickshell's popup but the simplest way is to go edit and rebuild qtwayland which is a huge pain
08:04vyivel: so uhhhh
08:05vyivel: i commented out the platformmenu hook and it seems to work correctly
08:05soreau: is this of any.. https://git.outfoxxed.me/outfoxxed/quickshell/src/branch/master/src/wayland/platformmenu.cpp#L16
08:05soreau: relevancy
08:06vyivel: also looks like a massive hack
08:06outfoxxed: its related, theres a patch in the chat above to match it to what i have locally
08:06outfoxxed: wayland_debug reveals it to be working as intended though
08:07outfoxxed: massive hacks are required where qtwayland comes into play though, extremely buggy
08:07vyivel: popus are positioned correctly for me without the linked patch and commented out platform hook
08:08outfoxxed: do they flip correctly
08:08outfoxxed: when hitting screen edges
08:08vyivel: yep
08:08vyivel: oh well
08:08vyivel: they don't flp
08:08vyivel: they slide
08:08outfoxxed: yeah they need to flip
08:08outfoxxed: the entire problem only happens when it flips
08:08outfoxxed: slide is terrible ux for context menus
08:09vyivel: is it
08:09outfoxxed: yes because submenus pile up on top of parent menus and its hard to go up a level
08:13kennylevinsen: Both slide and slip can end up covering the parent menu, no?
08:13outfoxxed: flip should not cover the parent menu
08:14outfoxxed: it should flip around it using the anchor rect
08:14kennylevinsen: Ah right
08:15kennylevinsen: But whether that’s possible depends on the geometry of the menu and screen, more so than slide - and then the question is whether a cut off menu is better UX than one that slided…
08:15outfoxxed: the geometry of the screen should always work with flip unless the screen is about 10 by 10 pixels
08:16outfoxxed: example of what it does in x11
08:16outfoxxed: https://litter.catbox.moe/h9kpez.png
08:17outfoxxed: (tested with Xwayland -retro -noreset :2)
08:18kennylevinsen: Ah fair. I was thinking of e.g. very tall menus that might not have enough room for a flip-y either
08:18outfoxxed: then its left up to the compositors which will likely fall back to slide iirc
08:19kennylevinsen: (Although in my opinion, nested hover-navigated menus are always bad UX as they’re too finicky to navigate - one can be fine, but having to keep your mouse position within a sliver to not accidentally navigate away is dumb.)
08:19kennylevinsen: No, the compositor isn’t allowed to fall back
08:19kennylevinsen: You have to specify if it’s allowed to slide
08:19kennylevinsen: If not, and there isn’t room for flip, it just runs off the edge
08:19outfoxxed: ah that must be why gtk specifies 63
08:20outfoxxed: tried setting that myself and it doesn't affect this particular bug though
08:21outfoxxed: I'll just do 15 myself then
08:23d_ed[m]: your anchors are wrong too, you probably want the window to start from the bottom left of your anchor rect, otherwise it'll cover the thing you're trying to flip round
08:25outfoxxed: have not gotten to making submenus work again but probably
08:25outfoxxed: I just took the anchors that gtk uses that work
08:26d_ed[m]: for a menu you want this:... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/UlXDRHkSFhuoWPOwSRJyxzou>)
08:26d_ed[m]: * for a menu you want this:... (full message at <https://matrix.org/_matrix/media/v3/download/matrix.org/LfIeisTWLMHSdXuwqgmqviiO>)
08:27outfoxxed: thanks
08:27outfoxxed: also whats the name of the bridged matrix room?
08:28d_ed[m]: https://matrix.to/#/#_oftc_#wayland:matrix.org
08:28outfoxxed: thanks
08:42outfoxxed[m]: test
08:42outfoxxed: alr
08:47karcio_: Hey, yesterday switched to wayland (sway) I can see I have a problem to run electron apps - so far using this switch enable-features=UseOzonePlatform --ozone-platform=wayland but it is pain - I would like to run apps from fuzzel or any other menu
08:48selckin: ask your $distro places, this is a development channel
08:49karcio_: Oh sorry
09:05outfoxxed: vyivel: I patched qtwayland to add an offset to popups, the bug remains
09:05outfoxxed: have not touched xdg_surface yet though, just the positioner
09:05vyivel: :shrug:
09:06vyivel: i've realized i've spent over 2 hours on this already which 2 hours of staring at c++/qt code too much
09:07outfoxxed: thanks for the effort at least
09:08outfoxxed: I'll patch window geometry and see if that does anything. if so that would be a bug in every implementation except hyprland right?
09:09vyivel: highly doubt it
09:09outfoxxed: I mean I did too but I've checked the wayland logs as well and I can't find anything that seems amiss
09:09outfoxxed: the surface geometry is basically the only difference
09:10kennylevinsen: hmm weston doesn't have a positioner test client? :/
09:10vyivel: looking at the logs, anchor rect x is set to "output width - menu width" and the flip is applied on top of that so the behavior is technically correct
09:12outfoxxed: that doesn't sound right
09:30outfoxxed[m]: <vyivel> "looking at the logs, anchor rect..." <- I reread this a couple times and I think I see whats happening now, thanks
09:31outfoxxed[m]: appears qt's normal positioner logic is still taking effect when it should be handled by wayland
09:56outfoxxed[m]: hacked around it on my end, thanks for pointing that out vyivel
09:56vyivel: 👍
10:20wlb: weston/main: Loïc Molinari * 13 commits https://gitlab.freedesktop.org/wayland/weston/compare/51eea1f2657cea01761cb231c59f8b38bb5bfd2b...ae53d196db860eccbe2f4955c0f76c626928e0d2
10:20wlb: weston Merge request !1366 merged \o/ (backend-pipewire: add support for rendering to DmaBufs https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1366)
14:17wlb: wayland-protocols Merge request !324 opened by Julian Orth (mahkoh) Add xdg-decoration-v2 protocol https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/324
15:05kennylevinsen: zamundaaa: hah, you commented with the same point at the same time
15:06zamundaaa[m]: lol
16:49wlb: weston/main: Derek Foreman * libweston: Don't change surface state in weston_surface_copy_content https://gitlab.freedesktop.org/wayland/weston/commit/0f8bd8dbc56d libweston/ compositor.c pixman-renderer.c renderer-gl/gl-renderer.c
16:49wlb: weston/main: Derek Foreman * renderers: Remove internal flush and attach https://gitlab.freedesktop.org/wayland/weston/commit/1fd99807ec34 libweston/ pixman-renderer.c renderer-gl/gl-renderer.c
16:49wlb: weston Merge request !1538 merged \o/ (libweston: Don't change surface state in weston_surface_copy_content https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1538)
18:11bl4ckb0ne: zamundaaa[m]: should I add anything regarding the compositor sending a new connector upon terminating a lease?
18:11bl4ckb0ne: i added mahkoh's sentance to the MR, but there's no way to get the connector back
18:47zamundaaa[m]: bl4ckb0ne: if you want