"Section" doesn't work anymore with Gtk+ >= 2.18 (client-side windows)

Bug #444358 reported by Mario Kemper (Romario)
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Shutter
Confirmed
High
Mario Kemper (Romario)

Bug Description

http://library.gnome.org/devel/gtk/2.18/gtk-migrating-ClientSideWindows.html

We currently use XQueryTree (see: man XQueryTree) to query the window tree information of foreign windows.
"GDK has been changed to use client-side windows. This means that there is no longer a 1-1 correspondence between GdkWindows and windows in the underlying window system."

Revision history for this message
Vadim Peretokin (vperetokin) wrote : Re: [Bug 444358] [NEW] "Section" doesn't work anymore with Gtk+ >= 2.18 (client-side windows)

?!

Revision history for this message
Mario Kemper (Romario) (mario-kemper) wrote :

Sorry for the short explanation - I was in a hurry.

The "Section" function queries the window tree information (a window consists of many subwindows) by calling an xlib function, XQueryTree. Before Gtk+ 2.18 most of the widgets had a corresponding xwindow. The information about the subwindows were used to detect them and draw a rectangle around them that illustrated their geometry.

The new Ubuntu release (Karmic Koala 9.10) delivers the latest Gnome and Gtk+ versions where GDK has been changed to use client-side windows. This means that the XServer no longer knows about the subwindow hierarchy of a Gtk+ window and we can't use the XQueryTree function any longer. Qt4.x does use something similar. You can test this with an Qt4.x application window like VirtualBox if you don't have a karmic installation available.

It is possible to query the children of a GDK-window, but this works only if your own application created that window. Shutter needs to get the children of foreign toplevel windows.

I don't have a clue how to fix that, but I'll send an e-Mail to the Gtk+ mailing list when I am back home. I'll post any answers here.

Revision history for this message
Mario Kemper (Romario) (mario-kemper) wrote :

One solution might be to use the accessibility framework:
http://projects.gnome.org/accessibility/

Accerciser is using it (the python bindings) to query the structure of toplevel windows:
http://live.gnome.org/GAP/PythonATSPI

There is also some work done to port AT-SPI to D-Bus (this would be the best solution for us):
http://www.linuxfoundation.org/en/Accessibility/ATK/AT-SPI/AT-SPI_on_D-Bus

Revision history for this message
Mario Kemper (Romario) (mario-kemper) wrote :

Relevant thread (gtk-app-devel mailing list):
http://markmail.org/thread/4at2gn6nsmdtmii5

Changed in shutter:
milestone: none → 1.0
Changed in shutter:
status: Confirmed → Invalid
Changed in shutter:
status: Invalid → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.