awesomeWM / awesome

awesome window manager
https://awesomewm.org/
GNU General Public License v2.0
6.39k stars 597 forks source link

Notifications are stuck in my config #3145

Closed TornaxO7 closed 4 years ago

TornaxO7 commented 4 years ago

Output of awesome --version:

awesome v4.3-862-g7a759432d-dirty (Too long)
 • Compiled against Lua 5.3.5 (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. Clone my configs (if you want, it should work out of the box)
  2. Install spotify, deepin-screen-recorder

Actual result:

Expected result:

psychon commented 4 years ago

I'm confused. Why the strike-through for deepin-screen-recorder? Did you manage to get that to work? Also, if Spotify is buggy, then why isn't that a bug in Spotify? And how are notifications involved? This seems like it could be several bug reports at once.

(Sorry, but instructions saying "install Spotify" means that I am not going to try to reproduce.)

Finally, since you say that this only happens with your config: I guess this worked at some point. What changed from "working" to "not working"?

TornaxO7 commented 4 years ago

I'm confused. Why the strike-through for deepin-screen-recorder? Did you manage to get that to work?

Sorry, in the last line was a mistake: I meant And now it's working.. deepin-screen-recorder is strike-through, because as I already mentioned in the expected result, that deepin-screen-recorder could be fixed by using awful.spawn(...) instead of awful.spawn.with_shell(....) which I used in the stable release of awesome.

Also, if Spotify is buggy, then why isn't that a bug in Spotify?

Well, spotify worked normally on the stabel release of awesome. These "bugs" appears, when I'm using awesome-git so I think that the error comes of the git version of awesome.

how are notifications involved?

Well I'm asking that myself... because somehow that doesn't work anymore in the awesome-git version.

TornaxO7 commented 4 years ago

Ok, I found the section why I'm getting all this weird behaviour:

naughty.config.defaults = {
    timeout = 5,
    text = "",
    screen = 1,
    ontop = true,
    margin = 20,
    border_width = 5,
    position = "top_right"
}

This is in my ~/.config/awesome/notify.lua file and this is the only part where I change the defaults of naughty. When I'm commenting it out all issues doesn't exist anymore (spotify works fine, I'm getting notifications and so on). I guess I have to configure differently.

TornaxO7 commented 4 years ago

Now I guess that I found the real reason why everything "crashes":

naughty.config.spacing = dpi(5)
naughty.config.padding = dpi(20)

naughty.config.defaults = {} -- this line breaks everything

I need to comment out naughty.config.defaults = {} to remove the weird behaviours.

naughty.config.spacing = dpi(5)
naughty.config.padding = dpi(20)

naughty.config.defaults.timeout = 5
naughty.config.defaults.text = ""
naughty.config.defaults.screen = 1
naughty.config.defaults.ontop = true
naughty.config.defaults.margin = 20
naughty.config.defaults.border_width = dpi(5)
naughty.config.defaults.position = "top_right"

Using that doesn't help either.
So something is probably wrong with naughty.config.defaults.

Elv13 commented 4 years ago

Umm, that makes sense. By clearing naughty.config.defaults, you remove some of the new stuff that's in there. Most of the code expects that table to have some keys and now they are gone, so stuff break. This was part of a major rewrite of naughty to make the notification fully customizable

https://awesomewm.org/apidoc/core_components/naughty.notification.html https://awesomewm.org/apidoc/popups_and_bars/naughty.layout.box.html

TornaxO7 commented 4 years ago

Oh well... I though that I need to initialize it as well.... dumb mistake xD

TornaxO7 commented 4 years ago

Umm... one question than: this should work right?

naughty.config.spacing = dpi(5)
naughty.config.padding = dpi(20)

naughty.config.defaults.screen = 1 -- those both lines break everything again
naughty.config.defaults.ontop = true

Because the two last lines break everything again.

TornaxO7 commented 4 years ago

Well I'm stupid.... naughty.config.defaults is for naughty.notify which is deprecated... sorry for that mess :sweat:... Anyway everything is working fine now. Thanks for your replies :)

Elv13 commented 4 years ago

I made a patch to avoid more people having issues with this. Monkey-patching any table not explicitly documented to be user settable isn't gonna go well. But for this one, I added some safety check to block the overriding while still respecting the intent.