-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Window.open should allow you to pick a screen #2384
Comments
Example use case: custom notifications |
Looking at what EDITI actualy meant to post this as a reply to #2383 |
adam, the way that i found works best for detecting the workspace, is by taking the screen with work_area less than bounds. This works on Windows, Mac and Ubuntu 14.04 tested. |
@Destreyf But on my Windows setup here the taskbar goes across all screens. Also, a colleague told me yesterday that the Mac menu / context bar can be on multiple screens since Mavericks (previously used to denote the primary screen). |
@adam-lynch if your taskbar really goes across all screens (e.g start button all the way on the left monitor, clock all the way on the right), then your graphics driver is setup as one big monitor and is not really using multi monitor support of windows per se. Its just one big desktop from the perspective of the applications. This would affect every app (such as e.g. lightroom) that has multi monitor features. This mode in the graphics card settings often doesnt make any sense. |
@matthiasg No, my starts button is on every screen and the clock is on the middle screen. This is a Windows feature. |
then you have multiple taskbars .. that's ok of course then you indeed have multiple true screens … i understood it such that you have one long taskbar (which would be a driver feature). But in that case there isn't much of an issue since you can position a window globally … e.g setting it to -1000,0 would position it on the left of the primary screen .. in combination with screen geometry that would get you started.. admittedly it would be extremely helpful to move this very common use cases into node-webkit to prevent people from re-implementing this over and over .. or a common external library that does the calculation and were required into the app could help too.. From: Adam Lynch @matthiasg No, my starts button is on every screen and the clock is on the middle screen. This is a Windows feature. — |
Not always. See #1152. |
The other ticket is talking about off screen .. Which might mean outside the screen area as defined by all monitors.. It might also mean off the primary screen.. Do you have more info on that ? -----Original Message----- But in that case there isn't much of an issue since you can position a window globally … e.g setting it to -1000,0 would position it on the left of the primary screen .. |
I created #2391 myself. To me, screen is an individual screen, the same meaning the screen API uses. |
I will try to recreate that with the 0.11 rc1 when I can then .. I will need some sensible multi monitor functionality relatively soon as we are starting to port our current medical image viewing application. I would assume a common library on top of NW would make sense, but that does require that positioning windows across all screens works of course -----Original Message----- I created #2391 myself. To me, screen is an individual screen, the same meaning the screen API uses. |
Maybe related #180? Its a little bit confusing, because most terms sound so similar (window, screen, desktop, monitor...) |
// Calculating for new win screen/position
const depWin = global._wins['home'] ||
global._wins['login'] || win
const winCX = depWin.x + depWin.width / 2
const winCY = depWin.y + depWin.height / 2
const curScr = _.find(screens, (scr) => {
const { x, y, width, height } = scr.bounds
return winCX >= x && winCX < x + width &&
winCY >= y && winCY < y + height
}) || screens[0] // todo: Some more calculating
const wrkCX = curScr.work_area.x + curScr.work_area.width / 2
const wrkCY = curScr.work_area.y + curScr.work_area.height / 2
opt.x = wrkCX - opt.width / 2
opt.y = wrkCY - opt.height / 2 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I guess by passing in a screen (/ screen ID) from the Screen API. The coordinates you give then should be relative to that screen. Should be optional & defaults to the current screen (where the app is placed) / the "primary" one (see #2383).
But then I guess if this was added, then there should also be a function to move a window to another screen (again by passing a screen / ID).
Related: #2178
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: