[#2731] [GTKUI] Fix potential AttributeError in is_on_active_workspace
* Without being able to replicate adding the forced updated is the likely fix for 'win' being None but also add test in case it's not...
This commit is contained in:
parent
520fc23371
commit
3b82059bdb
|
@ -339,11 +339,13 @@ class MainWindow(component.Component):
|
|||
bool: True if on active workspace (or wnck module not available), otherwise False.
|
||||
|
||||
"""
|
||||
if not wnck:
|
||||
return True
|
||||
if wnck:
|
||||
self.screen.force_update()
|
||||
win = wnck.window_get(self.window.window.xid)
|
||||
if win:
|
||||
active_wksp = win.get_screen().get_active_workspace()
|
||||
if active_wksp:
|
||||
return win.is_on_workspace(active_wksp)
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue