eepp / jome

An emoji picker desktop application
MIT License
39 stars 3 forks source link

Server-mode window opens unfocused in background (KDE) #7

Closed MightyPork closed 2 years ago

MightyPork commented 3 years ago

The server window opened by jome-ctl opens unfocused in background when KWin "focus stealing prevention" is anything above "None". I normally use "Medium".

If possible, could the server request focus after the window is shown?

Here is a workaround that seems to work:

#!/usr/bin/bash

activateit(){
  sleep 0.05
  xdotool windowactivate $(xdotool search --class "jome")
}

activateit &

emoji="$(jome-ctl jome.sock)"
echo "Selected: $emoji"

if [ $? -ne 0 ]; then
   exit 1
fi

echo -n "$emoji" | xclip -selection clipboard
echo -n "$emoji" | xclip -selection primary
echo -n "$emoji" | xclip -selection secondary

xdotool key --clearmodifiers shift+Insert
eepp commented 3 years ago

As I'm not a KDE user, I won't work on this one.

However I will gladly accept a patch.