Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#3895 closed defect (fixed)

Tabbinghandler not working

Reported by: erikos Owned by: erikos
Priority: Urgent Milestone:
Component: Sugar Version: 0.97.x
Severity: Blocker Keywords: regression, r+, olpc-testing-pending
Cc: mtd Distribution/OS: Unspecified
Bug Status: Assigned

Description

Gdk.keyboard_grab(window, False) takes 3 arguments (tabbinghandler.py)

Attachments (5)

tabbinghandler.patch (2.5 KB) - added by manuq 12 years ago.
Partial, unfinished patch.
0001-Fix-Tabbinghandler-not-working-SL-3895.patch (2.9 KB) - added by godiard 11 years ago.
New patch based in manuq work
tab_simon.patch (4.1 KB) - added by erikos 11 years ago.
testing patch with new API
0001-keygrabber-Handle-XI2-key-events.patch (1.5 KB) - added by erikos 11 years ago.
keygrabber: Handle XI2 key events (toolkit-gtk3)
0001-Tabbinghandler-port-the-tabbinghandler-to-the-new-GT.patch (5.3 KB) - added by erikos 11 years ago.
Tabbinghandler: port the tabbinghandler to the new GTK+3 API

Download all attachments as: .zip

Change History (19)

comment:2 Changed 12 years ago by manuq

It doesn't seem to be a direct way to get the keyboard device, but we can get a list of the master devices that should include it:

        display = Gdk.Display.get_default()
        device_manager = display.get_device_manager()
        self._devices = device_manager.list_devices(Gdk.DeviceType.MASTER)

Also we need the pointer device. There is a direct way for this one, and the list of devices includes it. In my system is the second element:

        self._pointer_device = device_manager.get_client_pointer()
        assert self._pointer_device == self._devices[1]

Changed 12 years ago by manuq

Partial, unfinished patch.

comment:3 Changed 12 years ago by manuq

Partial patch attached. I'm not sure about the parameters passed to the device.grab() method.

Pressing Alt-Tab I can switch to the next activity but then Sugar hangs. Log shows that device.ungrab() is not being called.

comment:4 follow-up: Changed 11 years ago by tonyforster

still present in OS3

comment:5 in reply to: ↑ 4 Changed 11 years ago by erikos

Replying to tonyforster:

still present in OS3

Thanks for testing again Tony. But if the ticket is still open there has not been a fix. Most of the time things don't get magically fixed :)

comment:6 Changed 11 years ago by mtd

  • Cc mtd added

comment:7 Changed 11 years ago by manuq

  • Priority changed from Unspecified by Maintainer to Urgent

Changed 11 years ago by godiard

New patch based in manuq work

comment:8 follow-up: Changed 11 years ago by godiard

  • Keywords r? added

I have uploaded a new patch for review.

This patch use the deprecated gdk-keyboard-grab, gdk-pointer-grab. Now I see it working, if we want, we can try use the new api.

Is not clear for me, why we need grab the mouse.

Another strange issue (may be a bug a lower levels) is after testing a lot, I can see cases where the mask returned by window.get_pointer() is 0, then the keyboard and mouse are not ungrabed. I have modified the condition to ungrab in that situation too.

Changed 11 years ago by erikos

testing patch with new API

comment:9 in reply to: ↑ 8 Changed 11 years ago by erikos

Replying to godiard:

I have uploaded a new patch for review.

This patch use the deprecated gdk-keyboard-grab, gdk-pointer-grab. Now I see it working, if we want, we can try use the new api.

I have attached a patch with the new API. Works the same as yours. Both do not show the Frame when tabbing. This is because right after grabbing we ungrab again. We have to compare with the old code.

Furthermore we should check how to handle the devices. Cache the keyboard device (like in my example patch)? Always request from new? How do we handle keyboards that are attached?

Is not clear for me, why we need grab the mouse.

To me is not clear neither. Tested on 12.1.0 without grabbing the mouse and it worked as expected. We should ask Benzea if we miss anything.

Another strange issue (may be a bug a lower levels) is after testing a lot, I can see cases where the mask returned by window.get_pointer() is 0, then the keyboard and mouse are not ungrabed. I have modified the condition to ungrab in that situation too.

Changed 11 years ago by erikos

keygrabber: Handle XI2 key events (toolkit-gtk3)

comment:10 Changed 11 years ago by erikos

The two latest patches brings back the tabbing functionality. We needed to patch as well the keygrabber to handle XI2 key events to get this working.

Only remaining item (can be done later) is to port gdk-window-get-pointer to gdk_window_get_device_position http://developer.gnome.org/gdk3/stable/gdk3-Windows.html#gdk-window-get-pointer

comment:11 Changed 11 years ago by godiard

A few comments:

  • In my devel system (sugar-build, F17) window.get_pointer() returns:

(<X11Window object at 0x2e2af50 (GdkX11Window at 0x2daf480)>, 235, 204, <flags GDK_MOD1_MASK of type GdkModifierType>)

then, there are one parameter more, and the code break. I don't know if we should check this, and try avoid the error, or if is something wrong in my system.

  • With your patches, I couldn't reproduce the situation where I received 0 in the mask.
  • I don't have a 12.1.0 system now to compare if the frame behavior changed, I see a little annoying showing it in the middle, but at the same time, look change the activity button, at top, is good. Is too late to design/discuss changes now, we hould keep how was working.
  • After changing the window.get_pointer() line, all works here.

Changed 11 years ago by erikos

Tabbinghandler: port the tabbinghandler to the new GTK+3 API

comment:12 Changed 11 years ago by godiard

  • Keywords r+ added; r? removed

New patch tested and working as expected.

comment:13 Changed 11 years ago by erikos

  • Keywords olpc-testing-pending added
  • Resolution set to fixed
  • Status changed from new to closed

shell: af7b783866fb92d715d128f777ba3ae802949f7e

toolkit-gtk3: a22d4ee50d362eb1f638111d287c81af70a8f5fc

comment:14 Changed 11 years ago by dnarvaez

  • Milestone 0.98 deleted

Milestone 0.98 deleted

Note: See TracTickets for help on using tickets.