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
eta
gajim
Commits
e281fb68
Commit
e281fb68
authored
6 years ago
by
Andrey Gursky
Committed by
Philipp Hörist
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix clipboard paste in inactive window
Fixes #9427
parent
989926a6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gajim/message_textview.py
+5
-9
5 additions, 9 deletions
gajim/message_textview.py
with
5 additions
and
9 deletions
gajim/message_textview.py
+
5
−
9
View file @
e281fb68
...
...
@@ -98,13 +98,9 @@ class MessageTextView(Gtk.TextView):
self
.
connect
(
'
paste-clipboard
'
,
self
.
_paste_clipboard
)
self
.
connect_after
(
'
paste-clipboard
'
,
self
.
_after_paste_clipboard
)
self
.
connect
(
'
focus
-in-event
'
,
self
.
_on_focus
_in
)
self
.
connect
(
'
grab-
focus
'
,
self
.
_on_
grab_
focus
)
self
.
connect
(
'
focus-out-event
'
,
self
.
_on_focus_out
)
start
=
buffer_
.
get_bounds
()[
0
]
buffer_
.
insert_with_tags
(
start
,
self
.
PLACEHOLDER
,
self
.
placeholder_tag
)
def
_on_buffer_changed
(
self
,
*
args
):
text
=
self
.
get_text
()
# Because of inserting and removing PLACEHOLDER text
...
...
@@ -136,11 +132,14 @@ class MessageTextView(Gtk.TextView):
text
=
buf
.
get_text
(
start
,
end
,
True
)
return
text
==
self
.
PLACEHOLDER
def
_on_focus_in
(
self
,
*
args
):
def
remove_placeholder
(
self
):
if
self
.
is_placeholder
():
self
.
get_buffer
().
set_text
(
''
)
self
.
toggle_speller
(
True
)
def
_on_grab_focus
(
self
,
*
args
):
self
.
remove_placeholder
()
def
_on_focus_out
(
self
,
*
args
):
buf
=
self
.
get_buffer
()
start
,
end
=
buf
.
get_bounds
()
...
...
@@ -155,9 +154,6 @@ class MessageTextView(Gtk.TextView):
spell_view
=
Gspell
.
TextView
.
get_from_gtk_text_view
(
self
)
spell_view
.
set_inline_spell_checking
(
activate
)
def
remove_placeholder
(
self
):
self
.
_on_focus_in
()
@staticmethod
def
_paste_clipboard
(
textview
):
if
textview
.
is_placeholder
():
...
...
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