Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Floorp bug sharing screen in waybar

Open gustavojoaquin opened this issue 1 year ago • 7 comments

Hi, when i share the screen in sway using waybar, i have this error: image this is my waybar configuration { "layer": "top", "mode": "dock", "position": "top", "height": 20, }

gustavojoaquin avatar May 15 '24 16:05 gustavojoaquin

Can you please add a bit more detail about this issue? I am not able to get enough context from the screenshot. Thanks

apiraino avatar May 17 '24 20:05 apiraino

yes, it happens when i share my screen in firefox or floorp, the indicator of screen sharing overlaps with waybar, I'm using sway, i don't tested it with other window manager image

gustavojoaquin avatar May 18 '24 03:05 gustavojoaquin

I believe this is unrelated to Waybar or even Sway, rather this is how Wayland places floating windows by default, in that case the screensharing widget of Floorp. Reminds me of the same issue when in a conference call (ex. Jitsi) using Firefox so I think the same solution could work.

If you want some level of control about where that widget is placed when you use that application, I think you can try setting that in your Sway config (see: man 5 sway), for example:

for_window [app_id="APP_ID" title="Title of the application..."] floating enable, move position 800 0;

To get the APP_ID, launch Floorp and move the mouse cursor over that widget. Then run this command:

$ swaymsg -t get_tree | jq -r '..|try select(.focused == true)'

Then reload Sway and see if the widget is now positioned somewhere else.

More references (for Firefox, but I think they also apply to your case):

  • https://bugzilla.mozilla.org/show_bug.cgi?id=1628431
  • https://old.reddit.com/r/swaywm/comments/ki1djq/how_to_prevent_firefox_launch_mic_and_webcam/

apiraino avatar May 18 '24 09:05 apiraino

I changed the /etc/enviroments file adding MOZ_ENABLE_WAYLAND=1, now it opens the window image

I executed $ swaymsg -t get_tree | jq -r '..|try select(.focused == true)' selecting this window i get this result:

{
  "id": 49,
  "type": "con",
  "orientation": "none",
  "percent": 1.0,
  "urgent": false,
  "marks": [],
  "focused": true,
  "layout": "none",
  "border": "pixel",
  "current_border_width": 1,
  "rect": {
    "x": 960,
    "y": 25,
    "width": 960,
    "height": 1055
  },
  "deco_rect": {
    "x": 0,
    "y": 0,
    "width": 0,
    "height": 0
  },
  "window_rect": {
    "x": 1,
    "y": 1,
    "width": 958,
    "height": 1053
  },
  "geometry": {
    "x": 0,
    "y": 0,
    "width": 56,
    "height": 31
  },
  "name": "Floorp — Sharing Indicator",
  "window": null,
  "nodes": [],
  "floating_nodes": [],
  "focus": [],
  "fullscreen_mode": 0,
  "sticky": false,
  "pid": 974,
  "app_id": "floorp",
  "visible": true,
  "max_render_time": 0,
  "shell": "xdg_shell",
  "inhibit_idle": true,
  "idle_inhibitors": {
    "user": "none",
    "application": "enabled"
  }
}

but the app_id seems to be "floorp", i also tried the same command with Floorp and i got the app_id "floorp" too, idk if this still work, how can i select that window?

gustavojoaquin avatar May 18 '24 16:05 gustavojoaquin

It works, I just replaced for_window [app_id="floorp" title="Floorp — Sharing Indicator"] floating enable, move position 950 0; image but i found this problem, the window have have a black space, i tried to resize, but it seems to be minimum window size, but when i share my microphone and camera, it works fine: image

gustavojoaquin avatar May 18 '24 17:05 gustavojoaquin

Glad that it worked. About why Sway shows the floating window with a black area, I cannot help on that. I would probably ask the Sway folks on IRC #sway

I think this issue can be closed.

apiraino avatar May 19 '24 11:05 apiraino

Thank you, you helped me a lot.

gustavojoaquin avatar May 19 '24 16:05 gustavojoaquin