Skip to content

Commit

Permalink
couple of fixes
Browse files Browse the repository at this point in the history
- take into account windows that are maximized and minimized at the same time
- listen to current window state changes because "active_window_changed" is not enough
  • Loading branch information
gabrielfin authored and flexiondotorg committed May 29, 2019
1 parent 11a3fe1 commit 0b7a750
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion window-buttons-applet/window-buttons-applet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ namespace WindowButtonsApplet{
List<Wnck.Window*> windows = Wnck.Screen.get_default().get_windows_stacked().copy();
windows.reverse();
foreach(Wnck.Window* w in windows) {
if(w->is_maximized()){
if(w->is_maximized() && !w->is_minimized()){
win = w;
break;
}
Expand Down
7 changes: 6 additions & 1 deletion window-menu-applet/window-menu-applet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ namespace WindowMenuApplet{
GLib.Settings gsettings;

public void reload(){
string behaviour = gsettings.get_string("behaviour");

if(window != null){
window->icon_changed.disconnect(button.icon_set);
window->actions_changed.disconnect(button.menu_set);
window->state_changed.disconnect(reload);
}

window = get_current_window();
Expand All @@ -23,6 +26,8 @@ namespace WindowMenuApplet{
if(window != null){
window->icon_changed.connect(button.icon_set);
window->actions_changed.connect(button.menu_set);
if(behaviour == "topmost-maximized")
window->state_changed.connect(reload);
}
}

Expand Down Expand Up @@ -68,7 +73,7 @@ namespace WindowMenuApplet{
List<Wnck.Window*> windows = Wnck.Screen.get_default().get_windows_stacked().copy();
windows.reverse();
foreach(Wnck.Window* w in windows) {
if(w->is_maximized()){
if(w->is_maximized() && !w->is_minimized()){
win = w;
break;
}
Expand Down
7 changes: 6 additions & 1 deletion window-title-applet/window-title-applet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ namespace WindowTitleApplet{
GLib.Settings gsettings;

public void reload(){
string behaviour = gsettings.get_string("behaviour");

if(window != null){
window->name_changed.disconnect(update);
window->state_changed.disconnect(reload);
}

window = get_current_window();
Expand All @@ -16,6 +19,8 @@ namespace WindowTitleApplet{

if(window != null){
window->name_changed.connect(update);
if(behaviour == "topmost-maximized")
window->state_changed.connect(reload);
}
}

Expand Down Expand Up @@ -50,7 +55,7 @@ namespace WindowTitleApplet{
List<Wnck.Window*> windows = Wnck.Screen.get_default().get_windows_stacked().copy();
windows.reverse();
foreach(Wnck.Window* w in windows) {
if(w->is_maximized()){
if(w->is_maximized() && !w->is_minimized()){
win = w;
break;
}
Expand Down

0 comments on commit 0b7a750

Please sign in to comment.