Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Border around Firefox developer tools popup #3899

Open
nuckle opened this issue Feb 19, 2024 · 11 comments
Open

Border around Firefox developer tools popup #3899

nuckle opened this issue Feb 19, 2024 · 11 comments

Comments

@nuckle
Copy link

nuckle commented Feb 19, 2024

Output of awesome --version:

awesome v4.3-1647-ge6f5c798-dirty (Too long)
 • Compiled against Lua 5.3.6 (running with Lua 5.3)
 • API level: 4
 • D-Bus support: yes
 • xcb-errors support: no
 • execinfo support: yes
 • xcb-randr version: 1.6
 • LGI version: 0.9.2
 • Transparency enabled: yes
 • Custom search paths: no

How to reproduce the issue:

  1. Open Firefox
  2. Open developer tools
  3. Hover a mouse over a property with an info mark

Actual result:

Default system awesomeWM config

image

Expected result:

Cinnamon

image

Tried to fix it using rules, but it still looks weird and buggy

rule = { 
	class = "Firefox",
	role = "Popup",
},
properties = {
	fullscreen = false,
	maximized = false,
	titlebars_enabled = false,
	skip_taskbar = true,
        border_width = 0
}

image

@actionless
Copy link
Member

i think in your rule you need to also set border_width to 0

@actionless actionless changed the title Invalid render for Firefox developer tools popup Border around Firefox developer tools popup Feb 19, 2024
@nuckle
Copy link
Author

nuckle commented Feb 19, 2024

i think in your rule you need to also set border_width to 0

I did, but the popup feels weird.

Sometimes it appears on the wrong side

image

Or it'll be empty (border to show that there is actually a window)

image

@actionless
Copy link
Member

actionless commented Feb 19, 2024

in that case mb rule is not actually matching that popup:

rule = {
class = "Firefox",
role = "Popup",
},

@nuckle
Copy link
Author

nuckle commented Feb 19, 2024

in that case mb rule is not actually matching that popup:

rule = {
class = "Firefox",
role = "Popup",
},

It actually changes when I change the values inside the rules, so the rule is matching. I checked the windows properties and it's definitely matching. But the windows itself is messed up. Sometimes position is wrong, window is empty, or it flickers. On DE (cinnamon) it works fine. Tried different profiles in Firefox, versions, result is the same

@actionless
Copy link
Member

in that case the good solution would be to unmanage those windows at all, by adding callback to a rule, which would call https://awesomewm.org/doc/api/classes/client.html#client:unmanage on the client

@nuckle
Copy link
Author

nuckle commented Feb 19, 2024

Am I doing this right? Because I get an error /usr/loca/sare/aweosme/lib/awful/client/focus.lua:118 invalid object when I spawn the popup

rule = { 
    class = "Firefox",
    role = "Popup",
},
properties = {
    fullscreen = false,
    maximized = false,
    titlebars_enabled = false,
    skip_taskbar = true,
    border_width = 0,
},
callback = function (c) 
 c:unmanage()
end

I tried to play around with callback, but no matter what I do, I still have something like this

screencast-240219-2131-12.mp4

@actionless
Copy link
Member

Am I doing this right? Because I get an error /usr/loca/sare/aweosme/lib/awful/client/focus.lua:118 invalid object

please provide full trace, not just error message

I tried to play around with callback, but no matter what I do, I still have something like this

2024-02-19--1708373628_1403x1023_scrot

@nuckle
Copy link
Author

nuckle commented Feb 20, 2024

Full trace
2024-02-20 13:31:58 W: awesome: luaA_dofunction:78: error while running function!
stack traceback:
	[C]: in metamethod '__index'
	/usr/local/share/awesome/lib/awful/client/focus.lua:118: in function 'awful.client.focus.filter'
	/usr/local/share/awesome/lib/ruled/client.lua:769: in method '_execute'
	/usr/local/share/awesome/lib/gears/matcher.lua:649: in method 'apply'
	/usr/local/share/awesome/lib/ruled/client.lua:303: in function 'ruled.client.apply'
error: /usr/local/share/awesome/lib/awful/client/focus.lua:118: invalid object
2024-02-20 13:31:58 W: Trying to emit signal 'manage' on invalid object
stack traceback:
2024-02-20 13:31:58 E: awesome: Error during a protected call: /usr/local/share/awesome/lib/gears/object/properties.lua:278: invalid object
stack traceback:
	[C]: in metamethod '__index'
	/usr/local/share/awesome/lib/gears/object/properties.lua:278: in function </usr/local/share/awesome/lib/gears/object/properties.lua:277>
	[C]: in function 'xpcall'
	/usr/local/share/awesome/lib/gears/protected_call.lua:41: in function </usr/local/share/awesome/lib/gears/protected_call.lua:40>
	(...tail calls...)
	/usr/local/share/awesome/lib/gears/timer.lua:280: in function 'gears.timer.run_delayed_calls_now'
2024-02-20 13:31:58 E: awesome: Error during a protected call: /usr/local/share/awesome/lib/gears/object/properties.lua:278: invalid object
stack traceback:
	[C]: in metamethod '__index'
	/usr/local/share/awesome/lib/gears/object/properties.lua:278: in function </usr/local/share/awesome/lib/gears/object/properties.lua:277>
	[C]: in function 'xpcall'
	/usr/local/share/awesome/lib/gears/protected_call.lua:41: in function </usr/local/share/awesome/lib/gears/protected_call.lua:40>
	(...tail calls...)
	/usr/local/share/awesome/lib/gears/timer.lua:280: in function 'gears.timer.run_delayed_calls_now'

@actionless
Copy link
Member

actionless commented Feb 20, 2024

yeah, your real error is 2024-02-20 13:31:58 W: Trying to emit signal 'manage' on invalid object

try some guard like, if c then or first do a delayed call (and next if c guard inside delayed call): https://awesomewm.org/doc/api/classes/gears.timer.html#gears.timer.delayed_call

@actionless
Copy link
Member

also, AFAIK JetBrains and few other java-based IDEs have similar problems with their popups, mb some advices from those topics would also help: https://github.com/awesomeWM/awesome/issues?q=label%3AJava+

@nuckle
Copy link
Author

nuckle commented Mar 4, 2024

I kinda fixed it. Still not perfect but for me it's enough. I also checked if the issue happens in Firefox Developer (from Nix) and it seems to be way better than regular version of Firefox.

    {
        rule = {
            class = "Firefox",
            role = "Popup"
        },
        properties = {
            border_width = 0,
            focus = false,
            focusable = false,
            valid = false,
            has_titlebar = false, -- custom property to disable titlebar
            placement = awful.placement.restore,
            ontop = true,
            size_hints_honor = true
        },
        callback = function(c)
            c.focus:raise()
            c.y = c.y - 25
        end
    },
    {
        rule = {
            class = "firefox-aurora",
            role = "Popup"
        },
        properties = {
            border_width = 0,
            placement = awful.placement.restore,
            has_titlebar = false  -- custom property to disable titlebar
        }
    }
screencast-240304-1502-38.mp4
screencast-240304-1500-57.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants