Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Weblate
gajim
Commits
f5411971
Commit
f5411971
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
if roster is in vd1, and we are in vd2 and we click systray, move roster from vd1 to vd2
parent
a8cb9d69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gtkgui_helpers.py
+13
-0
13 additions, 0 deletions
src/gtkgui_helpers.py
src/systray.py
+25
-2
25 additions, 2 deletions
src/systray.py
with
38 additions
and
2 deletions
src/gtkgui_helpers.py
+
13
−
0
View file @
f5411971
...
...
@@ -301,3 +301,16 @@ def get_invisible_cursor():
color
=
gtk
.
gdk
.
Color
()
cursor
=
gtk
.
gdk
.
Cursor
(
pixmap
,
pixmap
,
color
,
color
,
0
,
0
)
return
cursor
def
get_current_desktop
(
window
):
'''
returns the current virtual desktop for given window
NOTE: window is GDK window
'''
prop
=
window
.
property_get
(
'
_NET_CURRENT_DESKTOP
'
)
if
prop
is
None
:
# it means it's normal window (not root window)
# so we look for it's current virtual desktop in another property
prop
=
window
.
property_get
(
'
_NET_WM_DESKTOP
'
)
if
prop
is
not
None
:
# f.e. prop is ('CARDINAL', 32, [0]) we want 0 or 1.. from [0]
current_virtual_desktop_no
=
prop
[
2
][
0
]
return
current_virtual_desktop_no
This diff is collapsed.
Click to expand it.
src/systray.py
+
25
−
2
View file @
f5411971
...
...
@@ -25,6 +25,7 @@ import dialogs
import
os
import
tooltips
import
gtkgui_helpers
from
gajim
import
Contact
from
common
import
gajim
...
...
@@ -261,8 +262,30 @@ class Systray:
def
on_left_click
(
self
):
win
=
gajim
.
interface
.
roster
.
window
if
len
(
self
.
jids
)
==
0
:
if
win
.
get_property
(
'
visible
'
):
win
.
hide
()
# no pending events, so toggle visible/hidden for roster window
if
win
.
get_property
(
'
visible
'
):
# visible in ANY virtual desktop?
win
.
hide
()
# we hide it from VD that was visible in
# but we could be in another VD right now. eg vd2
# and we want not only to hide it in vd1 but also show it in vd2
if
os
.
name
!=
'
nt
'
:
root_window
=
gtk
.
gdk
.
screen_get_default
().
get_root_window
()
# current user's vd
current_virtual_desktop_no
=
gtkgui_helpers
.
get_current_desktop
(
root_window
)
# vd roster window is in
window_virtual_desktop
=
gtkgui_helpers
.
get_current_desktop
(
win
.
window
)
# if one of those is None, something went wrong and we cannot know
# VD info, just hide it (default action) and not show it afterwards
if
None
not
in
(
window_virtual_desktop
,
current_virtual_desktop_no
):
if
current_virtual_desktop_no
!=
window_virtual_desktop
:
# we are in another VD that the window was
# so show it in current VD
win
.
show
()
else
:
win
.
present
()
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment