#86 Add callbacks for window movement

None
closed
nobody
None
3
2015-03-11
2013-12-11
No

Dear developers

I am missing callback functions for WM_MOVE, WM_WINDOWPOSCHANGED and WM_WINDOWPOSCHANGING messages. So I can reposition my dialog whenever the glut window position changes.

Thanks.

Related

Feature Requests: #86

Discussion

  • dexterity2000

    dexterity2000 - 2013-12-11

    Reacting on WM_EXITSIZEMOVE in the windows procedure does a better job than the above mentioned messages since it gets called only after user interaction.

     
  • Diederick C. Niehorster

    Thanks for the suggestion! WM_MOVE handling and a new position callback are implemented in current trunk. I would love for you to have a look and improve things if possible. Please refer to the git clone of the svn repo at https://github.com/dcnieho/FreeGLUT to make contributing easier. Note that we also handle WM_SIZING so that the window keeps updating when being sized. I am not sure why something similar is not done for position changing (can't remember), but guess it either didn't work well or I didn't get to it. In any case, please feel free to fiddle with it and show us your proposed changes!

     
  • dexterity2000

    dexterity2000 - 2014-01-17

    Hello Diederick

    Thanks for coming back to me. It's nice to see that my request is being considered for implementation.

    In the meantime I downloaded the source code and added a WM_WINDOWPOSCHANGED message handler to the window procedure which in turn invokes a callback function. Finally I made a new freeglut.dll and distributed it with my project. Please have a look at the attached screenshot. The modification can be seen in action here: https://sourceforge.net/projects/quadtreesim/

    For my purposes the modification works quite well but of course it's not thoroughly tested for all possibilities. Therefore I didn't add my modifications to the official repository.

    Since I am currently very busy at work I can't contribute to freeglut actively. Nevertheless I will keep an eye on the project's progress and hope that some day my request will make it into a new official release of freeglut.

    Best Regards
    Frank

     
    • Diederick C. Niehorster

      Hi Frank,

      Thanks for the further feedback. I just tested, handling WM_SIZE and
      WM_MOVE are sufficient and easier than handling WM_WINDOWPOSCHANGED as
      then you need to figure out whether it was size or position that
      changed (or both!). You could consider using freeglut trunk instead of
      your own solution for being notified of position changes. This has the
      glutPositionFunc callback to let you know of the new x,y of the client
      area of the freeglut window (to align like you do, you need to take
      non-client area sizes into account probably, see the resizer demo for
      the required additions and such).

      Any testing is welcome and changes should be minimal for your program.
      Also, your prog will be ready for when the new freeglut version comes
      out!

      Thanks again!
      Dee

      On Sat, Jan 18, 2014 at 2:50 AM, dexterity2000
      dexterity2000@users.sf.net wrote:

      Hello Diederick

      Thanks for coming back to me. It's nice to see that my request is being
      considered for implementation.

      In the meantime I downloaded the source code and added a WM_WINDOWPOSCHANGED
      message handler to the window procedure which in turn invokes a callback
      function. Finally I made a new freeglut.dll and distributed it with my
      project. Please have a look at the attached screenshot. The modification can
      be seen in action here: https://sourceforge.net/projects/quadtreesim/

      For my purposes the modification works quite well but of course it's not
      thoroughly tested for all possibilities. Therefore I didn't add my
      modifications to the official repository.

      Since I am currently very busy at work I can't contribute to freeglut
      actively. Nevertheless I will keep an eye on the project's progress and hope
      that some day my request will make it into a new official release of
      freeglut.

      Best Regards
      Frank

      Attachment: WM_WINDOWPOSCHANGED_freeglut.png (34.9 kB; image/png)


      [feature-requests:#86] Add callbacks for window movement

      Status: open
      Created: Wed Dec 11, 2013 11:12 AM UTC by dexterity2000
      Last Updated: Fri Jan 17, 2014 07:59 AM UTC
      Owner: nobody

      Dear developers

      I am missing callback functions for WM_MOVE, WM_WINDOWPOSCHANGED and
      WM_WINDOWPOSCHANGING messages. So I can reposition my dialog whenever the
      glut window position changes.

      Thanks.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/freeglut/feature-requests/86/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Feature Requests: #86

      • dexterity2000

        dexterity2000 - 2014-01-19

        Hi Dee

        For my purposes a callback for WM_MOVE would be sufficient. Even a glutPositionFunc callback could be welcome. In which case I would have to resort to AdjustWindowRect() or GetSystemMetrics() functions to compute the screen coordinates from the client coordinates.

        I chose WM_WINDOWPOSCHANGED over WM_MOVE because all necessary information I needed is already in the WINDOWPOS structure such as the flag SWP_NOSIZE. But I do understand that one of freeglut's main objectives ist platform independency and thus an equivalent for WM_WINDOWPOSCHANGED on Linux/Unix platforms may not be readily available.

        I have another request regarding unicode support. The caption of the freeglut window doesn't support UTF 16 characters. For example cyrillic or asian characters appear as question marks. Please have a look at the screenshot.

        Thanks
        Frank

         
        • Diederick C. Niehorster

          Hi Frank,

          You don't have to use AdjustWindowRect() or GetSystemMetrics() to get
          screen coordinates, glutGet gives you the border sizes and such. Like
          I said, see the resizer demo.

          Yup, Unicode is not supported now. Its on the todo list as the feature
          has been requested before!

          Best,
          Dee

          On Mon, Jan 20, 2014 at 1:12 AM, dexterity2000
          dexterity2000@users.sf.net wrote:

          Hi Dee

          For my purposes a callback for WM_MOVE would be sufficient. Even a
          glutPositionFunc callback could be welcome. In which case I would have to
          resort to AdjustWindowRect() or GetSystemMetrics() functions to compute the
          screen coordinates from the client coordinates.

          I chose WM_WINDOWPOSCHANGED over WM_MOVE because all necessary information I
          needed is already in the WINDOWPOS structure such as the flag SWP_NOSIZE.
          But I do understand that one of freeglut's main objectives ist platform
          independency and thus an equivalent for WM_WINDOWPOSCHANGED on Linux/Unix
          platforms may not be readily available.

          I have another request regarding unicode support. The caption of the
          freeglut window doesn't support UTF 16 characters. For example cyrillic or
          asian characters appear as question marks. Please have a look at the
          screenshot.

          Thanks
          Frank


          [feature-requests:#86] Add callbacks for window movement

          Status: open
          Created: Wed Dec 11, 2013 11:12 AM UTC by dexterity2000
          Last Updated: Fri Jan 17, 2014 06:50 PM UTC
          Owner: nobody

          Dear developers

          I am missing callback functions for WM_MOVE, WM_WINDOWPOSCHANGED and
          WM_WINDOWPOSCHANGING messages. So I can reposition my dialog whenever the
          glut window position changes.

          Thanks.


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/freeglut/feature-requests/86/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Feature Requests: #86

  • Diederick C. Niehorster

    • status: open --> closed
    • Group: -->
     
  • Diederick C. Niehorster

    Position callback is now available in the recent 3.0.0 release

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks