mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
[#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
7ef9e3dbe0
commit
8e3d737adc
1 changed files with 10 additions and 8 deletions
|
@ -312,11 +312,13 @@ class MainWindow(component.Component):
|
||||||
bool: True if on active workspace (or wnck module not available), otherwise False.
|
bool: True if on active workspace (or wnck module not available), otherwise False.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if not wnck:
|
if wnck:
|
||||||
return True
|
self.screen.force_update()
|
||||||
win = wnck.window_get(self.window.window.xid)
|
win = wnck.window_get(self.window.window.xid)
|
||||||
active_wksp = win.get_screen().get_active_workspace()
|
if win:
|
||||||
if active_wksp:
|
active_wksp = win.get_screen().get_active_workspace()
|
||||||
return win.is_on_workspace(active_wksp)
|
if active_wksp:
|
||||||
else:
|
return win.is_on_workspace(active_wksp)
|
||||||
return False
|
else:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue