fvwmorg / fvwm3

FVWM version 3 -- the successor to fvwm2
Other
505 stars 79 forks source link

Move, Maximize function fails if rofi is running, fvwm throws error #905

Closed cysp74 closed 11 months ago

cysp74 commented 11 months ago

Fvwm throws "execute_complex_function: Grab failed, unable to execute immediate action" error and Move, Maximize functions fail if rofi is active and running in foreground. This issue comes up in different scenarios.

I tried to use InitialMapCommand style, eg.

Style *weechat* InitialMapCommand  Move screen DP-0.1 0 0
Style *Telegram* InitialMapCommand  Move screen DP-0.1 0 0

but failed and thrown the mentioned error.

Happened same if I used FvwmEvent eg.

DestroyFunc StartFunction
AddToFunc   StartFunction
+ I ModuleSynchronous FvwmEvent AggregatedEvents

[...]

DestroyModuleConfig AggregatedEvents:*
*AggregatedEvents: Cmd
*AggregatedEvents: PassID
*AggregatedEvents: add_window StartAppCustomized

[...]

DestroyFunc StartAppCustomized
AddToFunc StartAppCustomized
+ I ThisWindow ("*Telegram*") Move screen DP-0.1 0 0
+ I ThisWindow ("*WeeChat*") Move screen DP-0.1 0 0

However both ways work if rofi isn't active. As additional information here is the rofi related config:

InfoStoreAdd runcmd "rofi"
InfoStoreAdd runcmdopt "-disable-history -terminal xterm -theme Monokai -font 'mono 12' -modi drun,filebrowser,ssh,window,run -show drun -show-icons"

[...]

Test (x $[infostore.runcmd]) Key (*) a A 3 Exec exec $[infostore.runcmd] $[infostore.runcmdopt]

Logs

[1695466624.845531] FScreenInit: Using RandR 1.6
[1695466624.902436] main: Loading window states via (null)
[1695466756.704339] FScreenInit: Using RandR 1.6
[1695466756.721257] main: Loading window states via (null)
[1695466756.757411] FlocaleGetFontSet: [fvwm][FlocaleGetFontSet]: (-*-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-*-*,-*-fixed-mediu
m-r-normal-*-14-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-16-*-*-*-*-*-*-*) Missing font charsets:
[1695466756.757428] FlocaleGetFontSet: ISO8859-14
[1695466756.757433] FlocaleGetFontSet: , 
[1695466756.757438] FlocaleGetFontSet: KSC5601.1987-0
[1695466756.757443] FlocaleGetFontSet: , 
[1695466756.757447] FlocaleGetFontSet: GB2312.1980-0
[1695466756.757452] FlocaleGetFontSet: 
[1695466756.757758] parse_and_set_window_style: Bad style option: Color lightgrey/dimgrey
[1695466756.757825] parse_and_set_window_style: Bad style option: HilightFore black
[1695466756.757832] parse_and_set_window_style: Bad style option:  HilightBack grey
[1695466756.769615] initPanFrames: freeing panframes
[1695466756.769630] initPanFrames: finished setting up per-monitor panframes
[1695466756.793587] CMD_HideGeometryWindow: HideGeometryWindow is deprecated.  Converting to use: GeometryWindow hide Move,Resize
[1695466756.793783] parse_and_set_window_style: Bad style option: GrabFocusOn
[1695466756.799244] menustyle_parse_style: unknown option 'StaysOnTop'
[1695466756.809997] ParseBinding: Binding specified AnyModifier and other modifiers too. Excess modifiers are ignored.
[1695466756.813186] AddToFunction: Invalid function specifier: 'Nop'
[1695466758.750266] setup_window_placement: Expanding screen from 'null' -> ''
[1695466758.756308] setup_window_placement: Expanding screen from 'p' -> 'p'
[1695466808.359723] setup_window_placement: Expanding screen from 'null' -> ''
[1695466809.395295] execute_complex_function: Grab failed, unable to execute immediate action
[1695466920.272571] setup_window_placement: Expanding screen from 'null' -> ''
[1695466921.294622] execute_complex_function: Grab failed, unable to execute immediate action
ThomasAdam commented 11 months ago

Yeah,

This will be because rofi grabs the server, and fvwm will try and do likewise when running the commands you've mentioned.

One solution you could try is:

Style whatever InitialMapCommand Schedule 9000000000000000000 some_command

Obviously, replace 9000000000000000000 with something sensible.