wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Every time a xdg_popup is created, there is a wlroots error log

Open lilydjwg opened this issue 1 year ago • 3 comments

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Create a xdg_popup somehow (e.g. context menus)
  2. Check the log:
II 09-03-24 23:00:58.124 - [build/wayfire/src/view/xdg-shell.cpp:59] New xdg popup
EE 09-03-24 23:00:58.124 - [types/xdg_shell/wlr_xdg_surface.c:169] A configure is scheduled for an uninitialized xdg_surface 0x557ffd217530

Expected behavior No error logs.

Wayfire version git.

This patch fixes it, but I don't know if it introduces any issue:

diff --git a/src/view/xdg-shell.cpp b/src/view/xdg-shell.cpp
index 8340e932..09747202 100644
--- a/src/view/xdg-shell.cpp
+++ b/src/view/xdg-shell.cpp
@@ -110,7 +110,6 @@ std::shared_ptr<wayfire_xdg_popup> wayfire_xdg_popup::create(wlr_xdg_popup *popu
     self->surface_root_node = std::make_shared<wayfire_xdg_popup_node>(self->get_id());
     self->set_surface_root_node(self->surface_root_node);
     self->set_output(self->popup_parent->get_output());
-    self->unconstrain();
     return self;
 }
 

lilydjwg avatar Mar 09 '24 15:03 lilydjwg

Yeah it should be safe to remove this call. It should happen on map() instead (if it isn't happening already)

ammen99 avatar Mar 09 '24 17:03 ammen99

I've reverted my local change because I suspend it caused my Firefox extension's popup to misplace. I may need to do some debugging.

lilydjwg avatar Mar 09 '24 17:03 lilydjwg

It should happen on map() instead (if it isn't happening already)

I tried to move it there but the position is still wrong.

To reproduce, maximize Firefox, put an extension button on the left and click. Part of it will be out of screen:

图片

lilydjwg avatar Mar 10 '24 09:03 lilydjwg