I briefly played around with it, not bad at all. I did see the menus popped up in the wrong place though, something to note is that ConfigureNotify is a bit complicated in how it works. Let me copy/paste a comment from my simpledisplay.d:

/+
The ICCCM says window managers must send a synthetic event when the window is moved but NOT when it is resized. In the resize case, an event is sent with position (0, 0) which can be wrong and break the dpi calculations.

So we only consider the synthetic events from the WM and otherwise need to wait for some other event to get the position which... sucks.
+/
if(event.send_event) {
        win.screenPositionKnown = true;
        win.screenPositionX = event.x;
        win.screenPositionY = event.y;
}



You can also request the window position with XTranslateCoordinates:

int x, y;
Window dummyw;
XTranslateCoordinates(dpy, window.nativeHandle, RootWindow(dpy, DefaultScreen(dpy)), x, y, &x, &y, &dummyw);



Which is what I do when it is time to pop up a menu.


Your thing works ok when maximized tho, it is kinda nice how you got the rest working.

But as a fellow DIY widgetset author it is always fun to compare and contrast :)

And since some of these X things are a bit obscure it helps to steal tips from each other lol
  • WildCAD - a s... Johann Lermer via Digitalmars-d-announce
    • Re: Wild... Dadoum via Digitalmars-d-announce
      • Re: ... Johann Lermer via Digitalmars-d-announce
    • Re: Wild... Adam D Ruppe via Digitalmars-d-announce
      • Re: ... Johann Lermer via Digitalmars-d-announce
      • Re: ... Johann Lermer via Digitalmars-d-announce
        • ... Adam D Ruppe via Digitalmars-d-announce
      • Re: ... Johann Lermer via Digitalmars-d-announce
        • ... Adam D Ruppe via Digitalmars-d-announce
          • ... Johann Lermer via Digitalmars-d-announce
    • Re: Wild... Ferhat Kurtulmuş via Digitalmars-d-announce
      • Re: ... Johann Lermer via Digitalmars-d-announce
        • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
          • ... Adam D Ruppe via Digitalmars-d-announce

Reply via email to