GithubHelp home page GithubHelp logo

Comments (7)

janwilmans avatar janwilmans commented on May 27, 2024

I can see it now also, it seems to happen when you put it exactly on the limit at the edge of the screen.

from debugviewpp.

janwilmans avatar janwilmans commented on May 27, 2024

I think the problem occurs because I take the coordinates of the window from 'GetWindowPlacement' and compare them to coordinates from 'GetSystemMetrics' and looking at the coordinates I get, they aren't working in the same coordinate-system.

from debugviewpp.

frostius avatar frostius commented on May 27, 2024

If I remember right, all the coordinates need to be in the same scale (DPI) as the primary monitor.  GetScaleFactorForMonitor is what I use to convert dimensions

from debugviewpp.

frostius avatar frostius commented on May 27, 2024

from debugviewpp.

janwilmans avatar janwilmans commented on May 27, 2024

All coordinates are in pixels so no scaling is involved, but I use 'GetSystemMetrics' to know whether the stored coordinates are actually visible right now.

for example, if you have two monitors the 'virtual screen' size might be (-1920,0) - (1920,1200), but if one monitor is disconnected, half of the virtual screen's coordinates is now an 'off screen' location.

I have had complains in the past of 'debugview not showing', and this was the cause. So the prevent that I check the 'visibility' of the coordinates before restoring the window's position.

It not appears that the coordinates returned by GetSystemMetrics are not exactly aligned with the numbers coming from GetWindowPlacement...

This is where the positions are stored:
https://github.com/CobaltFusion/DebugViewPP/blob/master/DebugView%2B%2B/MainFrame.cpp#L760

and here we read/check/set them:
https://github.com/CobaltFusion/DebugViewPP/blob/master/DebugView%2B%2B/MainFrame.cpp#L684

from debugviewpp.

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.