Opened 3 years ago

Last modified 3 years ago

#10930 reopened defect

copy/paste does not work in if one has not revealed the edit toolbar once

Reported by: bert Owned by: godiard
Priority: high Milestone: 11.3.0
Component: sugar Version: not specified
Keywords: Cc: erikos, sridhar, dsd, tonyforster
Blocked By: Blocking:
Deployments affected: Action Needed: no action
Verified: no

Description

In the Terminal, ctrl-shift-c/v do not work as usual.

Also, after trying to paste by dragging a clipboard item out of the frame into Terminal, the frame broke (can't retract anymore).

Change History (30)

comment:1 Changed 3 years ago by erikos

  • Owner changed from sayamindu to manuq

comment:2 Changed 3 years ago by manuq

  • Status changed from new to assigned

Yes, all the accelerator changes on init are giving the following warning:

1306979684.059092 WARNING root: No gtk.AccelGroup in the top level window.

sent from sugar.graphics.toolbutton.ToolButton.

I should fix it.

Changed 3 years ago by manuq

comment:3 Changed 3 years ago by manuq

Attached a fix, but I'm looking for a better one.

comment:4 Changed 3 years ago by manuq

  • Action Needed changed from never set to review

comment:5 Changed 3 years ago by erikos

  • Action Needed changed from review to diagnose
  • Component changed from terminal-activity to sugar
  • Priority changed from normal to high

Actually looks like a Sugar issue:

  • open terminal
  • copy something with Ctrl+shift+c --->>> does not work
  • open the edit toolbar
  • copy something with Ctrl+shift+c --->>> does work

  • open Browse
  • copy something with Ctrl+c --->>> does not work
  • open the edit toolbar (you can even close it again)
  • copy something with Ctrl+shift+c --->>> does work

comment:6 Changed 3 years ago by erikos

  • Summary changed from os20: copy/paste do not work in Terminal to copy/paste does not work in if one has not revealed the edit toolbar once

comment:7 Changed 3 years ago by manuq

It happens only with the new toolbars, with the old ones it works as expected.

comment:8 Changed 3 years ago by erikos

The issue with the new toolbars is that we rely on the toplevel window when we want to set the accelerator [1][2]. We do set it for the activity window. The toplevel window of the Copy-button is only the activity window after the toolbar has been revealed once and the accelerator is not set before.

[1] http://git.sugarlabs.org/sugar-toolkit/mainline/blobs/master/src/sugar/graphics/toolbutton.py#line39

[2] http://www.pygtk.org/docs/pygtk/class-gtkwidget.html#method-gtkwidget--get-toplevel

comment:9 Changed 3 years ago by godiard

  • Action Needed changed from diagnose to review
  • Cc erikos added

I have added a method in the Window class, to walk the objects in the toolbar_box and update the accelerators, and optional parameters activity in the methods to set the accelerators in the class ToolButton.

This patch resolve the problem in activities Terminal and Browse without changing the activities. If in one activity the programmer set the toolbar_box in the activity before adding all the buttons, must call the update_accelerators methods after add the controls.

Simon, tell me if you like this approach.

comment:10 Changed 3 years ago by godiard

Simon,

I have looked at the code in sugar-toolkit/src/sugar/graphics/toolbarbox.py, and implemented a alternative solution using the 'hierarchy-changed' signal to pack the page when is possible. See patch 0001-Pack-page-in-ToolbarButton-when-is-conected-to-the-w.patch

This solution is more in line with the way used in toolbutton.py, but I don't like it because the signal is trigger many times and I think is suboptimal. The first patch can be less elegant but is not executing unneeded code all time. In fact with the first patch, we can remove the 'hierarchy-changed' signal handlers in toolbutton.py. See 0001-Remove-hierachy-changed-signal-handlers-in-toolbutto.patch

comment:11 Changed 3 years ago by sridhar

  • Cc sridhar added

comment:12 Changed 3 years ago by godiard

  • Owner changed from manuq to godiard
  • Status changed from assigned to new

comment:13 Changed 3 years ago by erikos

The only activity affected is Terminal it looks like. Browse and Write which have as well the new toolbar do work. This can be explained as Write is setting the accelerator to the non default values 'Ctrl+Shift+C'.

comment:14 Changed 3 years ago by erikos

from Walter:

The problem is not only in Terminal. I have the same problem with
Turtle Art, where I don'[t try to override the shortcut. My workaround
had been to open and then close the edit toolbar on startup, but that
only seems to work intermittently these days.

See http://bugs.sugarlabs.org/ticket/2050
See http://bugs.sugarlabs.org/ticket/2751

comment:15 Changed 3 years ago by godiard

Testing in TurtleArt and in Paint, I found is better use
0001-Pack-page-in-ToolbarButton-when-is-conected-to-the-w.patch

I can remove the workaround in TuirtleArt and continue working.
My other patch does not work, and looking at the code in TurtleArt have sense,
because the buttons and toolbars are created in different order.
This patch does not depends of the programmer create the toolbars in a specific order.

comment:16 Changed 3 years ago by godiard

Sent patch to sugar-devel

comment:17 Changed 3 years ago by erikos

  • Action Needed changed from review to add to build

Pushed: http://git.sugarlabs.org/sugar-toolkit/mainline/commit/3a81ba74385881b8638e800cdfdbb73a3708e7af

Fix is in sugar-toolkit-0.92.3.1.g3a81ba7-1.fc14.olpc.i686.rpm

comment:18 Changed 3 years ago by erikos

  • Action Needed changed from add to build to test in build
  • Cc dsd added

Is in 874.

Tested Write which works fine, TurtleArt does not start anymore, though.

comment:19 Changed 3 years ago by dsd

  • Action Needed changed from test in build to add to build
  • Milestone changed from 11.2.0-final to 11.3.0

We dropped this from 874 (erikos was testing a pre-release above) due the TurtleArt problem and the risk of there being more side effects. It is not a major bug; copy-paste is still available through more discoverable means, and does work with the keyboard in the majority of activities.

Ready for inclusion in 11.3.0 however! Thanks Gonzalo.

comment:20 Changed 3 years ago by dsd

TurtleArt ticket filed as http://bugs.sugarlabs.org/ticket/2986

comment:21 Changed 3 years ago by erikos

in sugar-toolkit-0.92.4-1.fc14.olpc.i686.rpm (in my public repo)

comment:22 Changed 3 years ago by dsd

  • Action Needed changed from add to build to test in build

test in 11.3.0 build 1

comment:23 Changed 3 years ago by greenfeld

  • Action Needed changed from test in build to no action
  • Resolution set to fixed
  • Status changed from new to closed

Cutting & pasting using the keyboard shortcuts in Terminal and Write work without revealing the edit toolbar.

Cutting & pasting using the menu selections after using the keyboard shortcuts in Terminal and Write also work as well.

Also tested Browse as well.

comment:24 Changed 3 years ago by tonyforster

  • Resolution fixed deleted
  • Status changed from closed to reopened

OS882, ctrl-c ctrl-v do not work in Turtle Art till the toolbar has been revealed

comment:25 Changed 3 years ago by tonyforster

  • Cc tonyforster added

comment:26 Changed 3 years ago by sridhar

Related OLPC AU bug report: http://dev.laptop.org.au/issues/773

Note: See TracTickets for help on using tickets.