Giter Site home page Giter Site logo

Snap not working about tvtest HOT 6 CLOSED

gdassieu avatar gdassieu commented on July 17, 2024
Snap not working

from tvtest.

Comments (6)

gdassieu avatar gdassieu commented on July 17, 2024

To add a bit more information to the issue.

When another application (example: notepad.exe) is resized by the user, below events are sent:

  • 1 event 0x000A EVENT_SYSTEM_MOVESIZESTART
  • several events 0x800B EVENT_OBJECT_LOCATIONCHANGE
  • 1 event 0x000B EVENT_SYSTEM_MOVESIZEEND

However, when TVTest is resized, only below is sent:

  • several events 0x800B EVENT_OBJECT_LOCATIONCHANGE
    (no events 0x800A and 0x800B are received).

I think Windows needs 0x000A and 0x000B to manage the snapping.

Best,

Gaston

from tvtest.

gdassieu avatar gdassieu commented on July 17, 2024

Hello,

I believe I have managed to fix the issue with Windows snap, without any negative impact on TVTest border snap and window move by clicking on TV area.

Attached is the updated MainWindow.cpp file with the corrections.
MainWindow.cpp.zip

Summary of the changes:

  1. Instead of managing window move using WM_MOUSEMOVE message (OnMouseMove function), we will manage it using the WM_MOVING message. The adjusted position (after border snapping) is returned using the WM_MOVING lParam (as described in Microsoft doc https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-moving). After this change, the window move sends the right events to the OS (EVENT_SYSTEM_MOVESIZESTART -> EVENT_OBJECT_LOCATIONCHANGE -> EVENT_SYSTEM_MOVESIZEEND) and Windows snap functions correctly.

  2. Side effect of previous change -> We can no longer drag the TVTest window by clicking on the TV area. To solve this, used the WM_LBUTTONDOWN message handler to re-send the click message as if it occurred in the title area (HTCAPTION). This is then used automatically to move the window.

Obviously, as I am not a member of TVTest development team, there's a chance these changes bring some regression. Anyway, I am fully available to help with testing and corrections if needed. Just let me know.

Cheers,

Gaston

from tvtest.

DBCTRADO avatar DBCTRADO commented on July 17, 2024

Hello, Thank you for your report.
I'll try testing your patch.

from tvtest.

DBCTRADO avatar DBCTRADO commented on July 17, 2024

I committed fix.

from tvtest.

DBCTRADO avatar DBCTRADO commented on July 17, 2024

Fixed behavior with 7aa8065

from tvtest.

gdassieu avatar gdassieu commented on July 17, 2024

Hi,
Thanks! I recompiled from the latest GIT repo, and I confirm it works well.
Best regards,
Gaston

from tvtest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.