| Ticket UUID: | 220856 | |||
| Title: | [winfo containing] doesn't work on non-root E desktops | |||
| Type: | Bug | Version: | 8.6.18, 9.0.5, 9.1.0 | |
| Submitter: | welch | Created on: | 2000-11-01 01:30:06 | |
| Subsystem: | 67. Unix Window Operations | Assigned To: | jenglish | |
| Priority: | 6 | Severity: | Minor | |
| Status: | Open | Last Modified: | 2026-10-24 08:38:39 | |
| Resolution: | None | Closed By: | nobody | |
| Closed on: | ||||
| Description: |
OriginalBugID: 2478 Bug Version: 8.2b1 SubmitDate: '1999-08-02' LastModified: '2000-03-07' Severity: MED Status: UnAssn Submitter: techsupp ChangedBy: sven RelatedBugIDs: 3777 4301 OS: Linux-Red Hat Machine: Other Name: John Ellson Comments: [email protected] (author of enlightenment) states: bug in tk - motif has the same bug with dnd. basically they asume eazch immediate chil o the root winow has on and onlyone appliation window in it - incorrect assumption to make. xwininfo, xprop anjmd others also suffer from thsi bad assumption. iccm oes nto forbid being able to reparent as many client windwos as the wm likes into another window. its badly written apps :) gtk's dnd code does it right :) so basically the answer is ... fix tk :) (nb - it will have he same problem with tvtwm i believe and amiwm - both are also virtal root winow wm's) ReproducibleScript: #!/usr/local/bin/wish # file "bug.tcl" illustrating "winfo containing" # problem on non-root E desktops (and poss other WMs) toplevel .t bind .t <B1-Motion> {puts [winfo containing %X %Y]} ObservedBehavior: Using Enlightenment WM. "winfo containing" doesn't work on non-root desktops. The test script generates two windows. One labelled "bug" and the other labelled "t". If the mouse-button-1 is held down over "t" and then dragged to "bug" you should see the window name reported repeatedly as the mouse is dragged. (I'm trying to implement drag&drop between windows.) If the script is executed on desktop 1 you see ".t" and then "" as you enter window "bug" This is incorrect. Somehow the mouse entry into they "bug" window is not detected when on desktops other than 0. DesiredBehavior: If the script is executed on desktop 0 you see ".t" and then "." as the mouse is dragged to window "bug" This is correct behavior | |||
| User Comments: |
serhiy.storchaka added on 2026-10-24 08:38:39:
I was wrong earlier: with a virtual root window this fails since 8.6.10 ([6942f5af38], the fix for [18a4ba19bd]) when each toplevel is in a window manager frame inside the virtual root, as with Enlightenment: Tk_CoordsToWindow() checked the point with coordinates relative to the real root instead of the virtual root. If the window manager puts several toplevels into one frame, only the first one was checked, in all versions. I reproduced both with a small program that emulates such a window manager. Fixed on branch x11-coords-to-window ([8a0667c7fc]): with it, winfo containing finds the toplevels in both cases, and still returns "" over the title bar and the desktop. erikleunissen added on 2026-10-16 11:35:26: OK, thanks. Then my understanding of the subject matter is not enough to express any judgment. serhiy.storchaka added on 2026-10-16 09:31:03: "The root window" is the root window of the X screen, and a "non-root desktop" is an Enlightenment virtual desktop other than desktop 0. Enlightenment showed these through a virtual root window, a large child of the real root that holds the toplevels of that desktop. The binding on .t is fine: while button 1 is held, X keeps sending the pointer events to the window where it was pressed, so <B1-Motion> of .t fires also over the other window. %X %Y are screen coordinates, so winfo containing should return . there, and it did on desktop 0. The empty result on the other desktops is a problem of winfo containing (Tk_CoordsToWindow()) with the virtual root, not of the binding. As described in my previous comment, the current code handles virtual roots and windows reparented deeper by the window manager, but I could not test it with Enlightenment 16: it is no longer in Ubuntu. erikleunissen added on 2026-10-16 09:23:25: First off:
I don't understand the ticket's original post fully:
* Does "the root winow" (sic) mean the Tk root window ?
* I don't know what the term "non-root" desktop means.
So, sorry in advance if I got it wrong because of this limited understanding.
But barring that, the observed behaviour by the OP seems correct to me since
the reproducible script uses ".t" as the binding tag. Therefore, no action is
to be expected by moving the screen pointer (B1-pressed) over other windows,
including the root window of the screen.
The expected behaviour is achieved by using "all" as the binding tag
bind all <B1-Motion> {puts [winfo containing %X %Y]}
serhiy.storchaka added on 2026-09-23 18:17:47: Tk_CoordsToWindow() (unix/tkUnixWm.c) does not assume one application window per child of the root: it resolves a virtual root (__SWM_VROOT) first and then descends the window hierarchy level by level with XTranslateCoordinates() until it meets the wrapper or the reparent window of one of our toplevels, so a window manager which reparents several clients into one window is handled by going deeper. Verified with 9.1b1 under fvwm1 1.24r, fvwm 2.7.0, ctwm, vtwm, Window Maker, metacity, xfwm4, icewm, i3, dwm and KWin: winfo containing returns the right toplevel for points inside two toplevels and an empty string over the desktop, also with the tiling window managers which place the windows where they like. None of these publishes __SWM_VROOT, and tvtwm and Enlightenment 16 are not available any more (the amiwm package does not start: it cannot decode its own default icon), so the original virtual root setup could not be retested. dkf added on 2000-12-01 03:03:56: Well, some of us would contend that the problem is with Enlightenment in the first place, but that's an argument for another place and time. If anyone wishes to contribute code to fix this, something may happen. If not, it won't get fixed since it works for a great many people's desktops (including, presumably, the majority of core Tk developers since nobody's worked on coming up with a fix) and we don't feel this one to be particularly critical. (Hey, it's not *my* desktop that's got problems with this... :^) | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki