gtk.gdk.Window.get_origin() returns 3 values instead of the documented 2-tuple

Bug #1273380 reported by Christopher Townsend
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gtk+3.0 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When calling gtk.gdk.Window.get_origin(), it returns 3 values instead of the documented 2-tuple of the x & y origin of the window. I'm not sure if the 3 values is intended and the documentation is wrong or if this is truly a bug.

Here is a simple way to reproduce.

1. Open a new window such as gedit.
2. Get the xid (Window id) for the window using a tool such as xwininfo.
3. Start a python shell.
4. Then in the python shell, enter this:

>>> from gi.repository import Gdk, GdkX11
>>> GdkX11.X11Window.foreign_new_for_display(Gdk.Display().get_default(), xid).get_origin() where xid is the xid obtained in step 2.

You will observe the output has 3 values looking something like this: (1, 66, 262)

I'm not sure what the first value is, but the second and third represent the x and y origin of the window.

Revision history for this message
Martin Pitt (pitti) wrote :

If you write "gtk.gdk.Window.get_origin()" then that is indeed pygtk, not GI. But as pygtk has been deprecated long ago, and your actual example uses GI (and gedit got ported to GI long ago as well), I take it you are using GTK through introspection.

The function is behaving as documented: https://developer.gnome.org/gdk/unstable/gdk-Windows.html#gdk-window-get-origin

I. e. it is supposed to return a 3-tuple (return value, x, y). The return value (i. e. the first part of the tuple) can be ignored as the documentation mentions.

affects: pygtk (Ubuntu) → gtk+3.0 (Ubuntu)
Changed in gtk+3.0 (Ubuntu):
status: New → Invalid
Revision history for this message
Christopher Townsend (townsend) wrote :

Hi Martin,

Thanks for the great explanation. Based on your comments, then this is a bug in process/_bamf.py in Autopilot. I will file a report for Autopilot to get that fixed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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