Replies: 6 comments 8 replies
-
Sure, you can dynamically assign a sensor property to the bar, i.e.:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Is the button working better? I.e. the panel doesn't disappear when you
unlock it?
If I'm not mistaken, the work the label, the panel disappears of the
pointer leaves the panel between locking and unlocking. The panel remains
visible if the pointer stays within the panel.
The code around pointer enter/leave events is messy. It's pretty much
workarounds on top of workarounds. I think one of the improvements I made
should let me simplify it and hopefully fix this issue in the process, but
I'm somewhat terrified of how many scenarios I'll break in the process ;)
…On Wed, 25 Dec 2024, 20:34 5Y1VN, ***@***.***> wrote:
I changed the label to a button and everything works nicely. Let me know
if you would like me to write this up as an issue. I can build and test any
revision/branch/PR in git if need be.
Button config:
function("SfwbarInit") {
bar_id "42"
SetBarSensor "700"
sensor 700
layer "overlay"
}
Function("SensorLock") {
[!UserState] Config "Layout 'panel' { sensor = 0 }"
[!UserState] SetValue "icons/misc/lock.svg"
[!UserState] UserState "on"
[!UserState] SetStyle "bar-locked"
[UserState] Config "Layout 'panel' { sensor = 700 }"
[UserState] SetValue "icons/misc/unlock.svg"
[UserState] UserState "off"
[UserState] SetStyle "bar-unlocked"
}
layout "panel" {
bar_id = "42"
sensor = 0
mirror = "*"
}
layout "panel:center" {
bar_id = "42"
css = "* { -GtkWidget-valign: center; }"
loc(1,2,1,1)
label {
value = "X"
}
}
layout "panel:start" {
bar_id = "42"
sensor = 0
css = "* { -GtkWidget-valign: start; }"
loc(1,1,1,1)
button {
css = "label { font-size: 0.8em; padding-right: 6px;}"
style = "bar-unlocked"
value = "icons/misc/unlock.svg"
local = true
action = Function "SensorLock"
}
}
layout "panel:end" {
bar_id = "42"
loc(1,3,1,1)
css = "* { -GtkWidget-valign: end; }"
tray {
cols = 1
}
}
#CSS
window {
-GtkWidget-direction: right;
}
label {
min-width: 32px;
min-height: 32px;
}
button#bar-locked {
background-color: red;
}
—
Reply to this email directly, view it on GitHub
<#293 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFBUHQFKBMI2WV2XYJ32HMJGJAVCNFSM6AAAAABUDO6DGSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRWGUYDEMI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
So the button doesn't affect the focus, while the label does? Can you test
if the button still works as expected if you attach the SensorLock function
to the right click ( action[3]= ) ?
Also, what compositor are you using? The focus is handled by the
compositor, so this issue is likely due to the interaction between sfwbar
and the compositor.
Sfwbar usually runs without any input. It does take exclusive input when
you click on a widget on order to query keyboard modifiers. I suspect that
unmapping a surface while sfwbar had exclusive focus causes the focus loss
with your compositor.
…On Wed, 25 Dec 2024, 22:09 5Y1VN, ***@***.***> wrote:
The button works much better than the label. To summarize what I see with
a button:
Lock - Sensor, Style and Value update, Panel locks in place and does not
disappear.
Unlock - Sensor, Style, and Value update, Panel unlocks, disappears
immediately, mouse move into sensor area summons the panel.
—
Reply to this email directly, view it on GitHub
<#293 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFAH22GRDGO3XGUKLTD2HMUKPAVCNFSM6AAAAABUDO6DGSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRWGUZDMNY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
What compositor is this with?
…On Thu, 26 Dec 2024, 19:40 5Y1VN, ***@***.***> wrote:
Correct. The button does not affect focus, the label does. After
right-clicking the label, I lose keyboard input and have to kill the
process or cycle it with the button.
Updated test case:
Config file
function("SfwbarInit") {
bar_id "42"
SetBarSensor "700"
sensor 700
layer "overlay"
}
Function("SensorLock") {
[!UserState] Config "Layout 'panel' { sensor = 0 }"
[!UserState] SetValue "icons/misc/lock.svg"
[!UserState] UserState "on"
[!UserState] SetStyle "bar-locked"
[UserState] Config "Layout 'panel' { sensor = 700 }"
[UserState] SetValue "icons/misc/unlock.svg"
[UserState] UserState "off"
[UserState] SetStyle "bar-unlocked"
}
Function("SensorLockLabel") {
[!UserState] Config "Layout 'panel' { sensor = 0 }"
[!UserState] SetValue "L"
[!UserState] UserState "on"
[!UserState] SetStyle "bar-locked"
[UserState] Config "Layout 'panel' { sensor = 700 }"
[UserState] SetValue "U"
[UserState] UserState "off"
[UserState] SetStyle "bar-unlocked"
}
layout "panel" {
bar_id = "42"
sensor = 0
mirror = "*"
}
layout "panel:center" {
bar_id = "42"
css = "* { -GtkWidget-valign: center; }"
loc(1,2,1,1)
label {
value = "X"
}
}
layout "panel:start" {
bar_id = "42"
sensor = 0
css = "* { -GtkWidget-valign: start; }"
loc(1,1,1,1)
grid {
button {
loc(1,1,1,1)
css = "label { font-size: 0.8em; padding-right: 6px;}"
style = "bar-unlocked"
value = "icons/misc/unlock.svg"
local = true
action[3] = Function "SensorLock"
}
label {
loc(1,2,1,1)
css = "label { font-size: 0.8em; padding-right: 6px;}"
style = "bar-unlocked"
value = "U"
local = true
action[3] = Function "SensorLockLabel"
}
}
}
layout "panel:end" {
bar_id = "42"
loc(1,3,1,1)
css = "* { -GtkWidget-valign: end; }"
tray {
cols = 1
}
}
#CSS
window {
-GtkWidget-direction: right;
}
label {
min-width: 32px;
min-height: 32px;
}
button#bar-locked {
background-color: red;
}
Button Action[3] Debug log
11:20:46.87 module: register expr function 'mid'
11:20:46.87 module: register expr function 'replace'
11:20:46.87 module: register expr function 'pad'
11:20:46.87 module: register expr function 'extract'
11:20:46.87 module: register expr function 'time'
11:20:46.87 module: register expr function 'elapsedstr'
11:20:46.87 module: register expr function 'getlocale'
11:20:46.87 module: register expr function 'disk'
11:20:46.87 module: register expr function 'ActiveWin'
11:20:46.87 module: register expr function 'min'
11:20:46.87 module: register expr function 'max'
11:20:46.87 module: register expr function 'str'
11:20:46.87 module: register expr function 'val'
11:20:46.87 module: register expr function 'upper'
11:20:46.87 module: register expr function 'lower'
11:20:46.87 module: register expr function 'gtkevent'
11:20:46.87 module: register expr function 'bardir'
11:20:46.87 module: register expr function 'widgetid'
11:20:46.87 module: register expr function 'windowinfo'
11:20:46.87 module: register expr function 'escape'
11:20:46.87 module: register expr function 'read'
11:20:46.87 module: register expr function 'interfaceprovider'
11:20:46.87 module: register action 'Exec'
11:20:46.87 module: register action 'Function'
11:20:46.87 module: register action 'PipeRead'
11:20:46.87 module: register action 'MenuClear'
11:20:46.87 module: register action 'MenuItemClear'
11:20:46.87 module: register action 'Menu'
11:20:46.87 module: register action 'MpdCmd'
11:20:46.87 module: register action 'Config'
11:20:46.87 module: register action 'MapIcon'
11:20:46.87 module: register action 'SetMonitor'
11:20:46.87 module: register action 'SetLayer'
11:20:46.87 module: register action 'SetMirror'
11:20:46.87 module: register action 'SetBarSize'
11:20:46.87 module: register action 'SetBarMargin'
11:20:46.87 module: register action 'SetBarID'
11:20:46.87 module: register action 'SetExclusiveZone'
11:20:46.87 module: register action 'SetBarSensor'
11:20:46.87 module: register action 'SetBarVisibility'
11:20:46.87 module: register action 'SetValue'
11:20:46.87 module: register action 'SetStyle'
11:20:46.87 module: register action 'SetTooltip'
11:20:46.87 module: register action 'UserState'
11:20:46.87 module: register action 'PopUp'
11:20:46.87 module: register action 'ClientSend'
11:20:46.87 module: register action 'Focus'
11:20:46.87 module: register action 'Close'
11:20:46.87 module: register action 'Minimize'
11:20:46.87 module: register action 'Maximize'
11:20:46.87 module: register action 'UnMinimize'
11:20:46.87 module: register action 'UnMaximize'
11:20:46.87 module: register action 'Eval'
11:20:46.87 module: register action 'SwitcherEvent'
11:20:46.87 module: register action 'ClearWidget'
11:20:46.87 module: register action 'TaskbarItemDefault'
11:20:46.87 module: register action 'WorkspaceActivate'
11:20:46.87 default output: eDP-1
11:20:46.87 hypr: can't open socket
11:20:46.89 include: /home/sylvan/.config/sfwbar/test_bar.config -> /home/sylvan/.config/sfwbar/test_bar.config
11:20:46.89 foreign toplevel state for 0x570538d33960:
11:20:46.89 app_id: 'firefox', title 'Button to toggle bar autohide · LBCrion/sfwbar · Discussion #293 — Mozilla Firefox'
11:20:46.89 foreign toplevel state for 0x570538d33de0: Activated,
11:20:46.89 app_id: 'xfce4-terminal', title 'Terminal'
11:20:46.89 expr: ""layout"" = "layout" (vstate: 0)
11:20:46.90 expr: ""layout"" = "layout" (vstate: 0)
11:20:46.90 expr: ""X"" = "X" (vstate: 0)
11:20:46.90 expr: ""bar-unlocked"" = "bar-unlocked" (vstate: 0)
11:20:46.90 expr: ""icons/misc/unlock.svg"" = "icons/misc/unlock.svg" (vstate: 0)
11:20:46.92 expr: ""bar-unlocked"" = "bar-unlocked" (vstate: 0)
11:20:46.92 expr: ""U"" = "U" (vstate: 0)
11:20:46.92 expr: ""layout"" = "layout" (vstate: 0)
11:20:46.92 expr: ""700"" = "700" (vstate: 0)
11:20:46.92 action: SetBarSensor '(null)', '700', widget=(nil), win=0 from '(null)', '"700"'
11:20:46.92 module: checking action `setbarsensor`
11:20:46.92 module: calling action `setbarsensor`
11:20:46.92 SetBarSensor is deprecated, please use sensor property instead
11:20:46.92 sni watcher org.kde.StatusNotifierWatcher registered
11:20:46.92 sni watcher org.freedesktop.StatusNotifierWatcher registered
11:20:46.92 sni host org.kde.StatusNotifierHost-139089: found watcher org.kde.StatusNotifierWatcher (:1.337)
11:20:46.92 sni host org.freedesktop.StatusNotifierHost-139089: found watcher org.freedesktop.StatusNotifierWatcher (:1.337)
11:20:46.92 sni watcher org.kde.StatusNotifierWatcher: registered host org.kde.StatusNotifierHost-139089
11:20:46.92 sni watcher org.freedesktop.StatusNotifierWatcher: registered host org.freedesktop.StatusNotifierHost-139089
11:20:49.57 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.59 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.61 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.62 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.63 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.65 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.67 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.68 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.70 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.72 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.73 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.75 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.77 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.78 image: icons/misc/unlock.svg @ 32 x 48
11:20:49.80 image: icons/misc/unlock.svg @ 32 x 48
11:20:51.53 image: icons/misc/unlock.svg @ 32 x 48
11:20:51.54 foreign toplevel state for 0x570538d33de0:
11:20:51.54 app_id: 'xfce4-terminal', title 'Terminal'
11:20:52.24 image: icons/misc/unlock.svg @ 32 x 48
11:20:52.25 image: icons/misc/unlock.svg @ 32 x 48
11:20:52.25 modifier state: 0
11:20:52.25 expr: ""SensorLock"" = "SensorLock" (vstate: 0)
11:20:52.25 action: Function '(null)', 'SensorLock', widget=0x570538e22070, win=0 from '(null)', '"SensorLock"'
11:20:52.25 module: checking action `function`
11:20:52.25 module: calling action `function`
11:20:52.25 expr: ""Layout 'panel' { sensor = 0 }"" = "Layout 'panel' { sensor = 0 }" (vstate: 0)
11:20:52.25 action: Config '(null)', 'Layout 'panel' { sensor = 0 }', widget=0x570538e22070, win=0 from '(null)', '"Layout 'panel' { sensor = 0 }"'
11:20:52.25 module: checking action `config`
11:20:52.25 module: calling action `config`
11:20:52.25 parsing config string: Layout 'panel' { sensor = 0 }
11:20:52.25 action: SetValue '(null)', '(null)', widget=0x570538e22070, win=0 from '(null)', '"icons/misc/lock.svg"'
11:20:52.25 module: checking action `setvalue`
11:20:52.25 module: calling action `setvalue`
11:20:52.25 expr: ""icons/misc/lock.svg"" = "icons/misc/lock.svg" (vstate: 0)
11:20:52.25 expr: ""on"" = "on" (vstate: 0)
11:20:52.25 action: UserState '(null)', 'on', widget=0x570538e22070, win=0 from '(null)', '"on"'
11:20:52.25 module: checking action `userstate`
11:20:52.25 module: calling action `userstate`
11:20:52.25 action: SetStyle '(null)', '(null)', widget=0x570538e22070, win=0 from '(null)', '"bar-locked"'
11:20:52.25 module: checking action `setstyle`
11:20:52.25 module: calling action `setstyle`
11:20:52.25 expr: ""bar-locked"" = "bar-locked" (vstate: 0)
11:20:52.25 foreign toplevel state for 0x570538d33de0: Activated,
11:20:52.25 app_id: 'xfce4-terminal', title 'Terminal'
11:20:52.27 image: icons/misc/lock.svg @ 32 x 48
11:20:52.28 image: icons/misc/lock.svg @ 32 x 48
11:20:52.31 image: icons/misc/lock.svg @ 32 x 48
11:20:52.32 image: icons/misc/lock.svg @ 32 x 48
11:20:52.34 image: icons/misc/lock.svg @ 32 x 48
11:20:52.35 image: icons/misc/lock.svg @ 32 x 48
11:20:52.37 image: icons/misc/lock.svg @ 32 x 48
11:20:52.38 image: icons/misc/lock.svg @ 32 x 48
11:20:52.40 image: icons/misc/lock.svg @ 32 x 48
11:20:52.42 image: icons/misc/lock.svg @ 32 x 48
11:20:52.43 image: icons/misc/lock.svg @ 32 x 48
11:20:52.45 image: icons/misc/lock.svg @ 32 x 48
11:20:52.47 image: icons/misc/lock.svg @ 32 x 48
Label Action[3] Debug log
11:22:19.73 module: register expr function 'mid'
11:22:19.73 module: register expr function 'replace'
11:22:19.73 module: register expr function 'pad'
11:22:19.73 module: register expr function 'extract'
11:22:19.73 module: register expr function 'time'
11:22:19.73 module: register expr function 'elapsedstr'
11:22:19.73 module: register expr function 'getlocale'
11:22:19.73 module: register expr function 'disk'
11:22:19.73 module: register expr function 'ActiveWin'
11:22:19.73 module: register expr function 'min'
11:22:19.73 module: register expr function 'max'
11:22:19.73 module: register expr function 'str'
11:22:19.73 module: register expr function 'val'
11:22:19.73 module: register expr function 'upper'
11:22:19.73 module: register expr function 'lower'
11:22:19.73 module: register expr function 'gtkevent'
11:22:19.73 module: register expr function 'bardir'
11:22:19.73 module: register expr function 'widgetid'
11:22:19.73 module: register expr function 'windowinfo'
11:22:19.73 module: register expr function 'escape'
11:22:19.73 module: register expr function 'read'
11:22:19.73 module: register expr function 'interfaceprovider'
11:22:19.73 module: register action 'Exec'
11:22:19.73 module: register action 'Function'
11:22:19.73 module: register action 'PipeRead'
11:22:19.73 module: register action 'MenuClear'
11:22:19.73 module: register action 'MenuItemClear'
11:22:19.73 module: register action 'Menu'
11:22:19.73 module: register action 'MpdCmd'
11:22:19.73 module: register action 'Config'
11:22:19.73 module: register action 'MapIcon'
11:22:19.73 module: register action 'SetMonitor'
11:22:19.73 module: register action 'SetLayer'
11:22:19.73 module: register action 'SetMirror'
11:22:19.73 module: register action 'SetBarSize'
11:22:19.73 module: register action 'SetBarMargin'
11:22:19.73 module: register action 'SetBarID'
11:22:19.73 module: register action 'SetExclusiveZone'
11:22:19.73 module: register action 'SetBarSensor'
11:22:19.73 module: register action 'SetBarVisibility'
11:22:19.73 module: register action 'SetValue'
11:22:19.73 module: register action 'SetStyle'
11:22:19.73 module: register action 'SetTooltip'
11:22:19.73 module: register action 'UserState'
11:22:19.73 module: register action 'PopUp'
11:22:19.73 module: register action 'ClientSend'
11:22:19.73 module: register action 'Focus'
11:22:19.73 module: register action 'Close'
11:22:19.73 module: register action 'Minimize'
11:22:19.73 module: register action 'Maximize'
11:22:19.73 module: register action 'UnMinimize'
11:22:19.73 module: register action 'UnMaximize'
11:22:19.73 module: register action 'Eval'
11:22:19.73 module: register action 'SwitcherEvent'
11:22:19.73 module: register action 'ClearWidget'
11:22:19.73 module: register action 'TaskbarItemDefault'
11:22:19.73 module: register action 'WorkspaceActivate'
11:22:19.73 default output: eDP-1
11:22:19.73 hypr: can't open socket
11:22:19.75 include: /home/sylvan/.config/sfwbar/test_bar.config -> /home/sylvan/.config/sfwbar/test_bar.config
11:22:19.75 foreign toplevel state for 0x555655783570:
11:22:19.75 app_id: 'firefox', title 'Button to toggle bar autohide · LBCrion/sfwbar · Discussion #293 — Mozilla Firefox'
11:22:19.75 foreign toplevel state for 0x555655787190: Activated,
11:22:19.75 app_id: 'xfce4-terminal', title 'Terminal'
11:22:19.75 expr: ""layout"" = "layout" (vstate: 0)
11:22:19.75 expr: ""layout"" = "layout" (vstate: 0)
11:22:19.76 expr: ""X"" = "X" (vstate: 0)
11:22:19.76 expr: ""bar-unlocked"" = "bar-unlocked" (vstate: 0)
11:22:19.76 expr: ""icons/misc/unlock.svg"" = "icons/misc/unlock.svg" (vstate: 0)
11:22:19.78 expr: ""bar-unlocked"" = "bar-unlocked" (vstate: 0)
11:22:19.78 expr: ""U"" = "U" (vstate: 0)
11:22:19.78 expr: ""layout"" = "layout" (vstate: 0)
11:22:19.78 expr: ""700"" = "700" (vstate: 0)
11:22:19.78 action: SetBarSensor '(null)', '700', widget=(nil), win=0 from '(null)', '"700"'
11:22:19.78 module: checking action `setbarsensor`
11:22:19.78 module: calling action `setbarsensor`
11:22:19.78 SetBarSensor is deprecated, please use sensor property instead
11:22:19.78 sni watcher org.kde.StatusNotifierWatcher registered
11:22:19.78 sni watcher org.freedesktop.StatusNotifierWatcher registered
11:22:19.78 sni host org.kde.StatusNotifierHost-139330: found watcher org.kde.StatusNotifierWatcher (:1.339)
11:22:19.78 sni host org.freedesktop.StatusNotifierHost-139330: found watcher org.freedesktop.StatusNotifierWatcher (:1.339)
11:22:19.78 sni watcher org.kde.StatusNotifierWatcher: registered host org.kde.StatusNotifierHost-139330
11:22:19.78 sni watcher org.freedesktop.StatusNotifierWatcher: registered host org.freedesktop.StatusNotifierHost-139330
11:22:22.76 image: icons/misc/unlock.svg @ 32 x 48
11:22:25.23 image: icons/misc/unlock.svg @ 32 x 48
11:22:25.24 foreign toplevel state for 0x555655787190:
11:22:25.24 app_id: 'xfce4-terminal', title 'Terminal'
(sfwbar:139330): Gtk-CRITICAL **: 11:22:27.848: gtk_window_get_window_type: assertion 'GTK_IS_WINDOW (window)' failed
11:22:27.85 modifier state: 0
11:22:27.85 expr: ""SensorLockLabel"" = "SensorLockLabel" (vstate: 0)
11:22:27.85 action: Function '(null)', 'SensorLockLabel', widget=0x5556557f87c0, win=0 from '(null)', '"SensorLockLabel"'
11:22:27.85 module: checking action `function`
11:22:27.85 module: calling action `function`
11:22:27.85 expr: ""Layout 'panel' { sensor = 0 }"" = "Layout 'panel' { sensor = 0 }" (vstate: 0)
11:22:27.85 action: Config '(null)', 'Layout 'panel' { sensor = 0 }', widget=0x5556557f87c0, win=0 from '(null)', '"Layout 'panel' { sensor = 0 }"'
11:22:27.85 module: checking action `config`
11:22:27.85 module: calling action `config`
11:22:27.85 parsing config string: Layout 'panel' { sensor = 0 }
11:22:27.85 bar_set_sensor: assertion 'IS_BAR(self)' failed
11:22:27.85 action: SetValue '(null)', '(null)', widget=0x5556557f87c0, win=0 from '(null)', '"L"'
11:22:27.85 module: checking action `setvalue`
11:22:27.85 module: calling action `setvalue`
11:22:27.85 expr: ""L"" = "L" (vstate: 0)
11:22:27.85 expr: ""on"" = "on" (vstate: 0)
11:22:27.85 action: UserState '(null)', 'on', widget=0x5556557f87c0, win=0 from '(null)', '"on"'
11:22:27.85 module: checking action `userstate`
11:22:27.85 module: calling action `userstate`
11:22:27.85 action: SetStyle '(null)', '(null)', widget=0x5556557f87c0, win=0 from '(null)', '"bar-locked"'
11:22:27.85 module: checking action `setstyle`
11:22:27.85 module: calling action `setstyle`
11:22:27.85 expr: ""bar-locked"" = "bar-locked" (vstate: 0)
—
Reply to this email directly, view it on GitHub
<#293 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFAWY66CRCCIYEZBN7L2HRLRZAVCNFSM6AAAAABUDO6DGSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRXGA4DONQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
-
Thank you. It looks like smithay based compositors don't flip keyboard
interactivity to off one sfwbar gives it up.
To give some background, wlr-layer- shell protocol originally had two
possible keyboard interactivity states: none and exclusive. If a layer
surface requested none, it would get no keyboard input, if it requested
exclusive, it would get all keyboard input, effectively stealing the focus
from all other applications.
With v3 of wlr-layer-shell a 3rd mode was added, on_demand. This would
allow a layer shell behave like a normal window: I.e. get keyboard
interactivity when user clicks on the surface.
Ideally, Sfwbar should use on_demand mode, but older wlroots based
compositors treat on_demand the same way as exclusive mode. I.e. if sfwbar
requests on_demand, it will get exclusive keyboard interactivity, steal
focus from other applications and you'll need to either kill it with a
mouse if you can or remote into the machine to kill it.
To avoid this scenario, sfwbar request keyboard interactivity state none.
When you click on sfwbar, it requests keyboard interactivity state
exclusive, queries keyboard modifiers and sets keyboard interactivity back
to none.
In the case of the sensor change, immediately, immediately after the
interactivity flip, sfwbar unmapped the layer shell surface (main bar
surface) and maps a replacement surface (a 1px thick transparent sensor
window).
It looks like smithay gets confused in this scenario and never restores the
keyboard inactivity to none for the main surface.
I think we may need to raise this with smithay devs to understand what's
happening under the hood and what sfwbar should do differently.
…On Thu, 26 Dec 2024, 23:46 5Y1VN, ***@***.***> wrote:
I tested the following WM/compositors:
- COSMIC/cosmic - Button works, Label steals focus
- COSMIC/niri - Button works, Label steals focus
- COSMIC/SwayFX - Everything works
- XFCE4/labwc - Everything works
—
Reply to this email directly, view it on GitHub
<#293 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFFE5L7HPLV3VBMVLLD2HSIOXAVCNFSM6AAAAABUDO6DGSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRXGM3DGNA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I think it would be good to open an issue with smithay, so we can figure
out either a way to play nice. The code you linked looks to be the correct
part (i.e. the part the deals with the layer shell keyboard interactivity).
Please tag me if you open an issue and I can provide details on how sfwbar
does things if they need any info.
…On Mon, Dec 30, 2024 at 7:05 PM 5Y1VN ***@***.***> wrote:
OK. Thanks for the explanation. The button works great for me so, I can
mark this as answered and provide a clear example for future users that
might find this.
Would you like me to bring this example to Smithay?
If so, do you think the client-toolkit would be the place to log the
issue? I have just started learning rust so pardon my use of the
vernacular. I see the KeyboardInteractivity enum here with the different
parameters you mentioned (default = none, OnDemand, Exclusive).
https://github.com/Smithay/client-toolkit/blob/ca6a36e4d5f4a171eea91eabe7c8ab9b17fa98e0/src/shell/wlr_layer/mod.rs#L183
—
Reply to this email directly, view it on GitHub
<#293 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASHPFFFNSOZXWXKCBZO7BH32IGKNVAVCNFSM6AAAAABUDO6DGSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRZHEZDGMA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently I initialize a bottom dock and a vertical side bar with
SetBarSensor "700"
. This works great to autohide my bar and dock. Sometimes I need the bar to stay "unhidden". I would like to write a function to call with a button/label action that would update the bar sensor to a different value or just unset it so the bar will stay "unhidden". Is this possible or is there a better way to achieve this?Beta Was this translation helpful? Give feedback.
All reactions