After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756848 - entryArea: Don't flash pasted text when using paste service
entryArea: Don't flash pasted text when using paste service
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-20 09:48 UTC by Florian Müllner
Modified: 2015-10-20 16:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
entryArea: Don't flash pasted text when using paste service (3.37 KB, patch)
2015-10-20 09:48 UTC, Florian Müllner
none Details | Review
entryArea: Don't flash pasted text when using paste service (3.47 KB, patch)
2015-10-20 11:09 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2015-10-20 09:48:43 UTC
See patch.

This would also allow us to handle entry text and pasted text separately in the future:
  "nick: what do you think about <ctrl-v>"
=> "nick: what do you think about https://paste.gnome.org/foobar"
Comment 1 Florian Müllner 2015-10-20 09:48:47 UTC
Created attachment 313728 [details] [review]
entryArea: Don't flash pasted text when using paste service

We currently decide whether to offer paste service integration when
the entry's text changes, which means that pasted text flashes up
briefly before switching to the paste UI. We can avoid this by
subclassing GtkEntry and intercepting the paste operation itself.
Comment 2 Bastian Ilsø 2015-10-20 10:11:19 UTC
(In reply to Florian Müllner from comment #1)
> Created attachment 313728 [details] [review] [review]
> entryArea: Don't flash pasted text when using paste service
> 
> We currently decide whether to offer paste service integration when
> the entry's text changes, which means that pasted text flashes up
> briefly before switching to the paste UI. We can avoid this by
> subclassing GtkEntry and intercepting the paste operation itself.

I can't get the patch to apply on master :s
Comment 3 Florian Müllner 2015-10-20 10:24:56 UTC
(In reply to Bastian Ilsø from comment #2)
> I can't get the patch to apply on master :s

Did you update after bug 756363 landed? (I also have the patch from bug 710731 locally, but that shouldn't conflict with the patch here)
Comment 4 Bastian Ilsø 2015-10-20 10:45:09 UTC
Review of attachment 313728 [details] [review]:

::: src/entryArea.js
@@ +21,3 @@
+    Name: 'ChatEntry',
+    Extends: Gtk.Entry,
+    Signals: { 'text-pasted': { param_types: [GObject.TYPE_STRING,

Getting:
[bastian@archxps polari]$ jhbuild run polari

(org.gnome.Polari:11327): Gjs-WARNING **: JS ERROR: ReferenceError: GObject is not defined
@resource:///org/gnome/Polari/js/entryArea.js:19
@resource:///org/gnome/Polari/js/roomStack.js:7
@resource:///org/gnome/Polari/js/mainWindow.js:15
@resource:///org/gnome/Polari/js/application.js:12
@resource:///org/gnome/Polari/js/main.js:10
start@resource:///org/gnome/gjs/modules/package.js:176
@/home/bastian/jhbuild/install/bin/polari:5

JS_EvaluateScript() failed
Comment 5 Florian Müllner 2015-10-20 11:09:34 UTC
Created attachment 313732 [details] [review]
entryArea: Don't flash pasted text when using paste service

Eeeks, sorry - did this on top of a local patch that already added the import. This one should be good.
Comment 6 Bastian Ilsø 2015-10-20 11:52:30 UTC
Review of attachment 313732 [details] [review]:

I had to remove the "set a paste title" commit to test pasting at all on master, but tested the patch now and it seems to work....so
LGTM :)
Comment 7 Florian Müllner 2015-10-20 16:35:16 UTC
Attachment 313732 [details] pushed as 362990f - entryArea: Don't flash pasted text when using paste service