CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2022
    Posts
    3

    How to find out the size of a current screen in a multi-monitor system with XLib

    Hello there, ladies and gentlemen,
    I have a legacy program to support, and what I am trying to do in particular is to make sure the Maximize button works as expected. In my situation "as expected" means blowing a program window up to the screen limits. It works OK when I have a single monitor (I call ScreenOfDisplay() and then use the width and height members of the returned structure as size limits). However when I have multi-terminal system I would like it to work the same way, i.e. occupying the screen of the monitor the program window is displayed. But in that case the returned structure refers to the total (logical) display and returns the combined width/height. Therefore the question: how to find out the physical screen's size rather than logical one's?
    And to add to the question... let say I drag the window from one physical screen (one monitor) to another, In that case I would like the program to be consistent and when maximized, occupy the "new" monitor's screen. That said, how to achieve that?
    Thank you everyone for your help!
    Mike

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to find out the size of a current screen in a multi-monitor system with XLib

    I'd recommend you to look at this J.Newcomer's essay:
    http://www.flounder.com/virtual_screen_coordinates.htm
    Victor Nijegorodov

  3. #3
    Join Date
    Feb 2022
    Posts
    3

    Re: How to find out the size of a current screen in a multi-monitor system with XLib

    Hi Victor,

    and thank you for the link - it is really interesting. I am on a different page though - I am using XLib... If you have any idea how to determine a current physical screen dimensions using Xlib, i will greatly appreciate it!

    BR,
    Mike

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: How to find out the size of a current screen in a multi-monitor system with XLib

    Sorry Mike!
    But I have know idea what XLib is and how it differs from standard MFC/Win32/...
    Victor Nijegorodov

  5. #5
    Join Date
    Feb 2022
    Posts
    3

    Re: How to find out the size of a current screen in a multi-monitor system with XLib

    Hi Victor,
    it's OK. Thank you for your attetion anyway... I used to resolve this issue in Windows environment myself many years ago, but not in XLib, which is so different.
    Spasibo!
    Mike

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured