Skip to content

Commit

Permalink
Ignore dock and desktop windows
Browse files Browse the repository at this point in the history
Fixed logic that determines whether the window in focus is the desktop
by using the window type from WNCK. Also added the Dock type to avoid
showing mate-menu and mate-panel, since activating them has undefined
behavior.
  • Loading branch information
vkareh authored and flexiondotorg committed Feb 16, 2020
1 parent c8e7c29 commit a00525a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 6 additions & 2 deletions window-buttons-applet/window-buttons-applet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,17 @@ namespace WindowButtonsApplet{

private Wnck.Window get_current_window(){
Wnck.Window* win = null;
Wnck.WindowType window_type;
string behaviour = gsettings.get_string("behaviour");

switch(behaviour){
case "active-always":
win = Wnck.Screen.get_default().get_active_window();
if(win != null && win->get_class_instance_name() == "desktop_window")
win = null;
if(win != null){
window_type = win->get_window_type();
if(window_type == Wnck.WindowType.DESKTOP || window_type == Wnck.WindowType.DOCK)
win = null;
}
break;
case "active-maximized":
win = Wnck.Screen.get_default().get_active_window();
Expand Down
8 changes: 6 additions & 2 deletions window-menu-applet/window-menu-applet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ namespace WindowMenuApplet{

private Wnck.Window get_current_window(){
Wnck.Window* win = null;
Wnck.WindowType window_type;
string behaviour = gsettings.get_string("behaviour");

switch(behaviour){
case "active-always":
win = Wnck.Screen.get_default().get_active_window();
if(win != null && win->get_class_instance_name() == "desktop_window")
win = null;
if(win != null){
window_type = win->get_window_type();
if(window_type == Wnck.WindowType.DESKTOP || window_type == Wnck.WindowType.DOCK)
win = null;
}
break;
case "active-maximized":
win = Wnck.Screen.get_default().get_active_window();
Expand Down
8 changes: 6 additions & 2 deletions window-title-applet/window-title-applet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ namespace WindowTitleApplet{

private Wnck.Window get_current_window(){
Wnck.Window* win = null;
Wnck.WindowType window_type;
string behaviour = gsettings.get_string("behaviour");

switch(behaviour){
case "active-always":
win = Wnck.Screen.get_default().get_active_window();
if(win != null && win->get_class_instance_name() == "desktop_window")
win = null;
if(win != null){
window_type = win->get_window_type();
if(window_type == Wnck.WindowType.DESKTOP || window_type == Wnck.WindowType.DOCK)
win = null;
}
break;
case "active-maximized":
win = Wnck.Screen.get_default().get_active_window();
Expand Down

0 comments on commit a00525a

Please sign in to comment.