Problem querying correct size of resized window - Xwindows

This is a discussion on Problem querying correct size of resized window - Xwindows ; I am currently programming a simple RIFF/WAV-file editor and I have noticed a problem: As I, before drawing the waveform into a window, want to know the current size of the window in order to fit the wave image there ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Problem querying correct size of resized window

  1. Problem querying correct size of resized window

    I am currently programming a simple RIFF/WAV-file editor and I have
    noticed a problem:

    As I, before drawing the waveform into a window, want to know the current
    size of the window in order to fit the wave image there properly, I query
    the window size after either Expose or ResizeRequest events with

    -----

    XGetWindowAttributes(display,win,&winattr);
    height=winattr.height;
    width=winattr.width;

    -----

    but when I actually enlarge the window by grabbing on its corner with the
    mouse and dragging, it still erroneously reports the original width and
    height of the window. As a consequence, the image after that appears also
    erroneously, the wave function appearing correctly on upper left corner
    but the rest blurred. I have tested this with both KDE and Blackbox window
    managers.

    What is wrong?


    Mikko Nummelin

  2. Re: Problem querying correct size of resized window

    Mikko Nummelin writes:

    > I am currently programming a simple RIFF/WAV-file editor and I have
    > noticed a problem:
    >
    > As I, before drawing the waveform into a window, want to know the
    > current size of the window in order to fit the wave image there
    > properly, I query the window size after either Expose or ResizeRequest
    > events with
    >
    > -----
    >
    > XGetWindowAttributes(display,win,&winattr);
    > height=winattr.height;
    > width=winattr.width;
    >
    > -----
    >
    > but when I actually enlarge the window by grabbing on its corner with
    > the mouse and dragging, it still erroneously reports the original
    > width and height of the window. As a consequence, the image after that
    > appears also erroneously, the wave function appearing correctly on
    > upper left corner but the rest blurred. I have tested this with both
    > KDE and Blackbox window managers.


    I check the size after ConfigureNotify events. I'm not enough of an X
    hacker to say it's correct, but it works for me.

    --
    Måns Rullgård
    mru@inprovide.com

+ Reply to Thread