forked from BambooEngine/ibus-bamboo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix focus window issue on Gnome Activity
- Loading branch information
1 parent
e093616
commit cc6a758
Showing
7 changed files
with
85 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package main | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/godbus/dbus" | ||
) | ||
|
||
func gnomeGetFocusWindowClass() ( string, error ) { | ||
conn, err := dbus.SessionBus() | ||
var s string | ||
if err != nil { | ||
return s, err | ||
} | ||
defer func() { | ||
if err = conn.Hello(); err == nil { | ||
conn.Close() | ||
} | ||
}() | ||
|
||
js_code := "global.get_window_actors().find(window => window.meta_window.has_focus()).get_meta_window().get_wm_class()" | ||
obj := conn.Object("org.gnome.Shell", "/org/gnome/Shell") | ||
var ok bool | ||
err = obj.Call("org.gnome.Shell.Eval", 0, js_code).Store(&ok, &s) | ||
if !ok { | ||
err = errors.New(s) | ||
} | ||
if (err != nil) { | ||
return "", err | ||
} | ||
return s, nil | ||
} | ||
|
||
func isGnomeOverviewVisible() ( bool ) { | ||
conn, err := dbus.SessionBus() | ||
if err != nil { | ||
return false | ||
} | ||
defer func() { | ||
if err = conn.Hello(); err == nil { | ||
conn.Close() | ||
} | ||
}() | ||
|
||
js_code := "Main.overview.visible" | ||
obj := conn.Object("org.gnome.Shell", "/org/gnome/Shell") | ||
var visible string | ||
var ok bool | ||
err = obj.Call("org.gnome.Shell.Eval", 0, js_code).Store(&ok, &visible) | ||
if !ok || err != nil { | ||
return false | ||
} | ||
return visible == "true" | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters