Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

change scene's popup layer after reparent #324

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

sevz17
Copy link
Collaborator

@sevz17 sevz17 commented Oct 17, 2022

TODO: find a better commit message

@sevz17
Copy link
Collaborator Author

sevz17 commented Oct 17, 2022

@fauxmight please can you try this?, it should fix the issue about layer popups appearing it the wrong monitor you mention in #279

@fauxmight
Copy link

No change.
Popup still shows at correct X, Y coordinates but ALWAYS on the monitor with 0, 0 coordinates, no matter which monitor the layer shell and cursor are on.

@sevz17
Copy link
Collaborator Author

sevz17 commented Oct 19, 2022

No change. Popup still shows at correct X, Y coordinates but ALWAYS on the monitor with 0, 0 coordinates, no matter which monitor the layer shell and cursor are on.

Mmm, which layer is the layer surface on?

@fauxmight
Copy link

@sevz17: Good point. I would not have thought to check for a difference with this. Tested with "bottom" (default) and "top" settings for layer:
bottom (default): pop-up shows at correct X, Y position but always on the 0,0 coordinate monitor
top: pop-up shows at CORRECT position on the CORRECT monitor

@sevz17 sevz17 force-pushed the layer-popups branch 2 times, most recently from 8aa0ae5 to c8e78be Compare October 24, 2022 01:04
@sevz17
Copy link
Collaborator Author

sevz17 commented Oct 24, 2022

@sevz17: Good point. I would not have thought to check for a difference with this. Tested with "bottom" (default) and "top" settings for layer: bottom (default): pop-up shows at correct X, Y position but always on the 0,0 coordinate monitor top: pop-up shows at CORRECT position on the CORRECT monitor

Ok, this confirm my guesses, this happens because we reparent the scene node to LyrTop to avoid rendering the popup below normal clients.

Can you check again please?

@fauxmight
Copy link

No change in behavior. Pop-up layer on correct monitor if Waybar's "layer" setting is "top." Pop-up layer ALWAYS on 0, 0 coordinate monitor if "layer" setting is "bottom" or allowed to remain default ("bottom").

@sevz17
Copy link
Collaborator Author

sevz17 commented Oct 27, 2022

Hm, can you give me the output of p *node, p *xdg_surface->popup, p l->geom and p *l->scene in gdb at the line 1017?

@fauxmight
Copy link

(gdb) p *node
$1 = {type = WLR_SCENE_NODE_TREE, parent = 0x555555585b70,
  state = {link = {prev = 0x555555f55aa0,
      next = 0x555555585b90}, children = {prev = 0x555555580910,
      next = 0x555555580910}, enabled = false, x = 1208,
    y = 21}, events = {destroy = {listener_list = {
        prev = 0x55555630b998, next = 0x55555630b998}}},
  data = 0x0}
(gdb) p *xdg_surface->popup
$2 = {base = 0x555556310dd0, link = {prev = 0x5555563acbe0,
    next = 0x5555563acbe0}, resource = 0x555556345180,
  committed = true, parent = 0x555555f2e740, seat = 0x0,
  geometry = {x = 1208, y = 21, width = 108, height = 171},
  positioner = {anchor_rect = {x = 1155, y = -4, width = 215,
      height = 25}, anchor = XDG_POSITIONER_ANCHOR_BOTTOM,
    gravity = XDG_POSITIONER_GRAVITY_BOTTOM,
    constraint_adjustment = (XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y), size = {
      width = 108, height = 171}, offset = {x = 0, y = 0}},
  grab_link = {prev = 0x0, next = 0x0}}
(gdb) p l->geom
$3 = {x = 1920, y = 0, width = 1920, height = 17}
(gdb) p *l->scene
$4 = {type = WLR_SCENE_NODE_TREE, parent = 0x555555584c40,
  state = {link = {prev = 0x555555584c60,
      next = 0x555555f4bb40}, children = {prev = 0x555555f0e990,
      next = 0x555555f0e990}, enabled = true, x = 1920, y = 0},
  events = {destroy = {listener_list = {prev = 0x555555f0e8a8,
        next = 0x555555f0e8a8}}}, data = 0x555555f0e7e0}
(gdb) kill
Kill the program being debugged? (y or n) y
(EE) failed to read Wayland events: Broken pipe
[Inferior 1 (process 3870116) killed]
(gdb)

@sevz17
Copy link
Collaborator Author

sevz17 commented Nov 1, 2022

Can you try again please?

This new patch is larger than I'd like, but it also may help with popup repositioning (at this moment only available in wlroots-next)

@fauxmight
Copy link

@sevz17: This is perfect now. The popup shows in the correct position on the correct monitor regardless of waybar's layer value.

Thank you for your work all over dwl and on this issue in particular.

this tree should be always above the top layer

Fixes: djpohly#328
@sevz17 sevz17 merged commit 8bd3442 into djpohly:main Nov 1, 2022
@sevz17
Copy link
Collaborator Author

sevz17 commented Nov 1, 2022

Thanks!

@sevz17 sevz17 deleted the layer-popups branch November 1, 2022 18:54
@sevz17 sevz17 mentioned this pull request Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants