multiple-monitors

SDL fake fullscreen mode on dual monitor setup under linux

送分小仙女□ 提交于 2020-01-02 02:19:45
问题 Using SDL 1.3 I want to create fake fullscreen SDL_Window under linux. It is easy if i have only one display. I just got current display mode and created a window. SDL_GetDesktopDisplayMode(0, &mode); SDL_Window *win = SDL_CreateWindow("my window", 0,0,mode.w, mode.h, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS ); But when i have two displays, things get complicated. The window spreads across multiple monitors. SDL sees only one, double sized virtual display. I tested it with

How to figure out on which screen a JDialog is shown

会有一股神秘感。 提交于 2020-01-01 09:32:10
问题 I have a really big application which has multiple dialogs. My task is to make sure that a dialog, which is not completely visible (because the user pulled it out of the visible screen area) is moved back to the center of the screen. That's no problem when I'm dealing with one screen only. It works just fine ... however, most users of this application have two screens on their desktop ... When I try to figure out on which screen the dialog is shown and center it on that specific screen, ...

How to detect duplicated monitors as separate screens

折月煮酒 提交于 2019-12-31 01:47:09
问题 Using the answer in this question I can get the "screen" count. However, this doesn't seem to work with monitors that are set to "duplicate" (one monitor is reported instead of 2). My application prompts a user to switch from VGA to HDMI (this is on a device with both output ports), and then puts a "can you see this?" prompt on screen to verify that both video ports are working. I am trying to detect that the switch has happened before showing the prompt, but due to the above mentioned

How to make a dialog(view) open up on the same monitor as the main window

落爺英雄遲暮 提交于 2019-12-31 00:50:11
问题 In a PC with multiple monitors, say you run your application which have have a second Window/Dialog other than the main window (such as Options) that you want it to open in the same screen/monitor as your MainWindow . How to force this behavior? You basically want to stop the scenario that your MainWindow is on one monitor and when you bring up the "Options" page, it shows on a different screen/monitor. 回答1: Have you looked at the WindowStartupLocation property for Window ? CenterScreen

Showing a window with WPF, Winforms, and Dual monitors

独自空忆成欢 提交于 2019-12-28 21:42:21
问题 I have a 2 monitors and a WinForm app that launches a WPF window. I want to get the screen that the WinForm is on, and show the WPF window on the same screen. How can I do this? 回答1: WPF doesn't include the handy System.Windows.Forms. Screen class, but you can still use its properties to accomplish your task in your WinForms application. Assume that this means the WinForms window and _wpfWindow is a defined variable referencing the WPF Window in the example below (this would be in whatever

How to make X11 window span multiple monitors

时光怂恿深爱的人放手 提交于 2019-12-28 04:20:49
问题 I'm trying to use XResizeWindow() to make a window which will span 2 monitors, but the ?window manager? is limiting it to one. Is there a hint or property I can associate with the window to tell the WM not to limit it? For my test case, I have two 1600x1200 monitors that nVidia is presenting as one 3200x1200 screen to KDE4. XDisplayWidth(display, 0); returns 3200 and XDisplayHeight(display, 0); returns 1200. When I call XCreateWindow(display, DefaultRootWindow(display), 220, 0, 1700, 930, 1,

Running RPA UI interactions in a virtualized environment

最后都变了- 提交于 2019-12-24 23:54:30
问题 I've built several bots using RPA Express which are operating successfully so long as there is a display attached (local or via RDP) to enable the UI interactions. However, the UI interactions fail as soon as the RDP connection is lost. I'm looking to run the bots unattended on VMs, but can't seem to get around this issue. I have had some luck using tscon upon logging off an RDP session, but the results are inconsistent and the likelihood of the 'console' display failing increases the longer

Second Cursor is not triggering a screen refresh

冷暖自知 提交于 2019-12-24 21:17:57
问题 I previously posted about controlling two separate cursors in two xsessions. (http://stackoverflow.com/questions/13714831/controlling-multiple-pointers-with-xlib-or-xinput-in-ubuntu-linux) That solution worked well. However, a odd thing occurs when I control the cursor. Instead of the cursor moving normally and the screen refreshing to adjust, the cursor is on top of a white box and when I move it the cursor leaves a trail and nothing refreshes. This only happens when I move the newly created

Get monitor index from its handle (HMONITOR)

假装没事ソ 提交于 2019-12-24 20:30:21
问题 I'm interested in getting the monitor index (1-based, to match Windows numbering) given the monitor handle. Case of use: given a window's rect I want to know the monitor it belongs to. I can get the handle of the monitor using MonitorFromRect: // RECT rect const HMONITOR hMonitor = MonitorFromRect(rect, MONITOR_DEFAULTTONEAREST); How can I get the monitor index from this handle? PS: not sure if duplicate, but I've been looking around with no luck. 回答1: I found this post with the opposite

Get monitor serial number using PyQt

不问归期 提交于 2019-12-24 11:28:23
问题 I helping out on an FOSS application which uses PyQt 5. It is a dual screen application, and I would like to track the monitors that get connected, and persist settings if they get disconnected. We're using QScreen for the info we need, and this is great, but on Windows and on Linux the 'serialNumber' property returns an empty string, as does the 'manufacturer' and 'model' properties. import sys from PyQt5 import QtGui app = QtGui.QGuiApplication(sys.argv) print(repr(app.screens()[0]