How does mouse generate resize event? - Xwindows

This is a discussion on How does mouse generate resize event? - Xwindows ; Using only Xlib functions, I created a window with override-exclusive set to true. I can make the window any color, draw to it, refresh it, and handle the expose events. Now I want to be able to handle the resize ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: How does mouse generate resize event?

  1. How does mouse generate resize event?

    Using only Xlib functions, I created a window with override-exclusive set to
    true. I can make the window any color, draw to it, refresh it, and handle
    the expose events.

    Now I want to be able to handle the resize events. I can hard-code a resize
    with no problem and redraw the window in a very primative array-of-pixels
    manner. I assumed that if I took my mouse to the bottom-right corner of the
    window, held down the left mouse button, and dragged up, I would trigger a
    resize event. Nope. Just a mouse click event.

    If I set override-exclusive to false, the window manager puts its border on
    the window and I get the event I was looking for.

    So I'm guessing that such response (resizing a window by dragging at the
    corner) is a function left to the window manager and I have to hard-code
    such functionality (I'm not trying to write a window manager, but I am
    bypassing the WM to draw the window). True? Or is such functionality built
    into the X Server already and I'm not masking the event correctly?

    Thanks!
    --

    Tom Bitsky, Jr
    tbj@automateddesign.com

    Automated Design Corporation
    P: (630) 783-1150 F: (630) 783-1159



  2. Re: How does mouse generate resize event?

    Thomas Junior wrote:

    [override_redirect set]
    > Now I want to be able to handle the resize events. I can hard-code a resize
    > with no problem and redraw the window in a very primative array-of-pixels
    > manner. I assumed that if I took my mouse to the bottom-right corner of the
    > window, held down the left mouse button, and dragged up, I would trigger a
    > resize event. Nope. Just a mouse click event.

    [...]
    > So I'm guessing that such response (resizing a window by dragging at the
    > corner) is a function left to the window manager and I have to hard-code
    > such functionality (I'm not trying to write a window manager, but I am
    > bypassing the WM to draw the window). True? Or is such functionality built
    > into the X Server already and I'm not masking the event correctly?


    X Window doesn't implement or enforce policy, e.g. how to resize a window.
    When bypassing the WM, you have to program such interactive resizing
    yourself by evaluating button press, pointer motions and button release
    for instance. When resized the window, you can send yourself a synthetic
    configure notify, so you don't need to change the whole event loop.

    Regards,
    Daniel

  3. Re: How does mouse generate resize event?

    Daniel Rakel wrote:

    > for instance. When resized the window, you can send yourself a synthetic
    > configure notify, so you don't need to change the whole event loop.


    Not needed (too much wm code in the head).

    Regards,
    Daniel

  4. Re: How does mouse generate resize event?

    Actually, when I was thinking about the code last night, that's exactly what
    I thought I would have to do (generate a synthetic resize). But after
    reading your post and thinking about it, it's probably makes more sense just
    to resize and move on to the expose event, since I'll have to have a
    seperate handler for the mouse position anyway.

    Thanks!
    "Daniel Rakel" wrote in message
    newsan.2003.11.12.09.43.35.422089@ID-48088.user.uni-berlin.de...
    > Daniel Rakel wrote:
    >
    > > for instance. When resized the window, you can send yourself a synthetic
    > > configure notify, so you don't need to change the whole event loop.

    >
    > Not needed (too much wm code in the head).
    >
    > Regards,
    > Daniel




  5. Re: How does mouse generate resize event?

    Thomas Junior wrote:

    > I thought I would have to do (generate a synthetic resize). But after
    > reading your post and thinking about it, it's probably makes more sense just
    > to resize and move on to the expose event, since I'll have to have a
    > seperate handler for the mouse position anyway.


    What I've meant: You don't need to generate a synthetic configure, since
    you get a real one (if selected).

    Regards,
    Daniel



+ Reply to Thread