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 405868 - Missing implementation of gdk_window_get_geometry()
Missing implementation of gdk_window_get_geometry()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Quartz
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-quartz maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-02-08 19:31 UTC by Taybin Rutkin
Modified: 2007-08-02 09:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
simple implementation (456 bytes, patch)
2007-02-08 19:32 UTC, Taybin Rutkin
none Details | Review
(More complete?) Patch (1.58 KB, patch)
2007-07-22 20:39 UTC, Stefan Gehn
none Details | Review

Description Taybin Rutkin 2007-02-08 19:31:20 UTC
Please describe the problem:
gdk_window_get_geometry() in gdkwindow-quartz.c is unimplemented.

Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Taybin Rutkin 2007-02-08 19:32:43 UTC
Created attachment 82175 [details] [review]
simple implementation
Comment 2 Richard Hult 2007-02-09 07:42:44 UTC
Thanks!

Adding my comments from gtk-devel-list:

This looks like a good start. I wonder if we perhaps should try to mimic the X11 backend more closely and get the geometry from the NSWindow instead of using get_position/get_size that use the latest cached value? I think that you also need to check for a destroyed window (and perhaps special-case the root window).
Comment 3 Stefan Gehn 2007-07-22 20:39:58 UTC
Created attachment 92171 [details] [review]
(More complete?) Patch

Handles toplevel-, child- and root-window
Patch does build and did not cause any sideeffects on my GKrellM build. No intensive testing done so far.
Comment 4 Richard Hult 2007-07-22 22:35:57 UTC
Thanks, looks good. One small comment, we are using the GNU coding style i GTK+, so patches in that style are appreciated. This is a small one so I can just fix it and commit, but for any bigger ones please consider trying to follow the style of the rest of the code.

Thanks again!

Comment 5 Richard Hult 2007-07-31 19:27:39 UTC
I have committed a variant of the patch. I made some changes: First, we need to accept NULL and treat it as the root window. Second, the coordinates should actually be relative to the parent window in the X sense of it, i.e. for windows with borders, it should be relative to the window manager's frame, which unfortunately seems impossible to do without poking at private cocoa  APIs, so I made it return (0, 0) for that case instead. For borderless windows it should be relative to the root, which works nicely.

The bordered case seems kind of useless to me, so I will close this as fixed. If someone wants to look at fixing the less common case, feel free.

Thanks again!
Comment 6 Stefan Gehn 2007-08-02 09:06:00 UTC
small comment on this part:

----
  g_return_if_fail (window == NULL || GDK_IS_WINDOW (window));

  if (!window)
    window = _gdk_root;
----

I'd say the if() part is never reached. If you want it to work for the root-window you have to remove "window == NULL", no? :)
Comment 7 Richard Hult 2007-08-02 09:17:26 UTC
No, that part makes sure that the window either is NULL, or a valid window object.