#1008 Focus bug on switching workspace by hotkey

open
nobody
None
5
2013-07-31
2011-02-23
KDr2
No

Fluxbox 1.3.0
XServer 1.9.4
Debian sid, Linux 2.6.33.4 #7 SMP i686 GNU/Linux

Suppose you bind the command :NextWorkspace/:PrevWorkspace to a hotkey, e.g:
[code]
F1 :NextWorkspace
[/code]
Then press and release the key F1 very quickly(in less than 1 second), the command
'NextWorkspace' works, and the focus will be on a purticular Window(the titlebar is highlight),
but the focus was not on the right widget of that purticular Window, after this the focus will go to
the right widget of that window only if you press any key to fire a XKeyEvent.

An example:
Place one gnome-terminal window in each of your workspaces, let them grab the focus in
their own workspace, then swicth between the workspaces with pressing hotkey quickly,
after entering a new workspace, you can not type in the gnome-terminal immediately(the cursor
is bot binking now), press any key slowly to fire a XKeyEvent, than you will see a blink cursor...

This occurs only you press your hotkey very quickly.

Discussion

  • Lars Engels
    Lars Engels
    2011-02-24

    Me too!</aol>

    Happens also for me with FB 1.3.0 on FreeBSD.

     
  • KDr2
    KDr2
    2011-02-25

    Before this bug is fixed, You can write a script using wmctrl -d/wmctrl -s to switch workspace, bind the script to your hotkey use :ExecCommand.

     
  • reproduced on Ubuntu 11, FB 1.3.1

    the workaround with wmctrl -s does helps

     
  • lazy.et
    lazy.et
    2011-07-21

    This one drove me crazy.
    Here a script that emulates fluxbox commands I use.
    #!/bin/bash

    if [[ -z "$1" ]]; then
    exit 1
    fi

    case "$1" in
    ":Workspace") target_workspace=$(($2-1))
    ;;
    ":RightWorkspace") target_workspace=$(wmctrl -d | grep -A1 '[[:digit:]]\+ \+\*' | tail -n 1 | cut -f1 -d ' ')
    ;;
    ":LeftWorkspace") target_workspace=$(wmctrl -d | grep -B1 '[[:digit:]]\+ \+\*' | head -n 1 | cut -f1 -d ' ')
    ;;
    ":NextWorkspace") wsps=$(wmctrl -d | grep -A1 '[[:digit:]]\+ \+\*')
    case $(echo "$wsps" | wc -l) in
    1) target_workspace=$(wmctrl -d | head -n 1 | cut -f1 -d ' ')
    ;;
    2) target_workspace=$(echo "$wsps" | tail -n 1 | cut -f1 -d ' ')
    ;;
    *) echo "Weird wc output" > /dev/stderr
    exit 1
    ;;
    esac
    ;;
    ":PrevWorkspace") wsps=$(wmctrl -d | grep -B1 '[[:digit:]]\+ \+\*')
    case $(echo "$wsps" | wc -l) in
    1) target_workspace=$(wmctrl -d | tail -n 1 | cut -f1 -d ' ')
    ;;
    2) target_workspace=$(echo "$wsps" | head -n 1 | cut -f1 -d ' ')
    ;;
    *) echo "Weird wc output" > /dev/stderr
    exit 1
    ;;
    esac
    ;;
    *) echo "Command $1 not yet implemented" > /dev/stderr
    exit 1
    ;;
    esac

    wmctrl -s $target_workspace

     
  • edman007
    edman007
    2013-07-31

    FYI, this is a dup of bug #1067 and I think I have a working patch (posted in the comments there)