Opening a new browser page on the second monitor - browser

Well, simple situation. Is it possible to detect if a user has a dual monitor setup from a web application?
If this is possible, is it possible to open a child browser page on this second monitor, so the new window doesn't overlap the old one?
Reason why I ask: I'm working on a web application and at home I have a dual-monitor system. When I go to the administration part of this site, I want it to open in a new browser, preferably on the other desktop. Of course, I could just click, then drag the new window, but doing this automatically seems more fun. :-)
Don't think JavaScript has the proper functions for this. How about Java itself?

I don't think you'll be able to directly detect a dual monitor setup, but you can probably make a good guess by looking at their screen resolution, using javascript's screen.width and screen.height. If the ratio of the width to the height is 8:3, its a good chance they have 2 standard 4:3 monitors side by side. You can do a similar calculation for 16:9 or 16:10.

Using maxpower47's suggestion about resolution, the only way to display the page on the other monitor would be to open a popup, and use the options to set the top, right, width and height properties so the window will appear on the second monitor in a decent size.
Here is a link that describes how to do this: http://www.netmechanic.com/news/vol4/javascript_no7.htm

Related

Displaying a Classification Banner at the top of each computer monitor in Gnome Desktop

I work in an environment where we have to have a security classification banner displayed at the top of each monitor on our Gnome Desktops. Currently, I am using a Perl/Tk window to display the classification of the system. However, that window cannot be moved because of the way it is built (no decorations) and occasionally overlays open windows making it difficult for users to manage those windows.
I would like to be able to do something different, but I'm not sure where to start. Three ideas I have are this:
An icon or something in the Top Bar showing the classification
A banner, like the Top Bar, that sits above the Top Bar
A window, like I already have, but relocatable
I figure the first option would be easiest, but since the Top Bar isn't shown on every monitor, that may not be the best option. I don't even know if the second option is even possible. The third option would require me to use something other than Perl/Tk but that's the only language I'm fluent in at the moment.
So I'm looking for suggestions or examples or Gnome extensions I can use to solve this problem.
Thanks.
There is a classification-banner python utility at https://github.com/fcaviggia/classification-banner. It's no longer maintained, but we've been using it without change for a few years now. It's OK. One problem is that it doesn't "shrink" the desktop screen, so application windows can overlap it; it's set to Always On Top, but it would be nicer if it actually couldn't be overlaid at all.
A simple solution, of sorts, would be to change the desktop background image. This can have issues if you're displaying on multiple resolutions (I don't know if Gnome supports SVG for such purposes) and of course it can be obscured by windows covering it.
Older versions of Gnome let you create multiple bars that worked perfectly, but that disappeared - along with many other customizations - in Gnome 3.

Win 10: Any way to determine which monitor's taskbar the user clicked to launch an application?

I have a multi-monitor config that duplicates the task bar on each monitor. I also have an application with an icon in the taskbar (thus it shows on all monitors), and I'd like this application to behave differently depending on which monitor the click came from.
Is it possible to determine which monitor's taskbar was used to launch that app? I would just need the API function names (rather than actual code).
Thanks!
Whether or not what I asked in my OP is possible, I found a way to do what I want: Immediately upon launch, I obtain the current mouse position in absolute coordinates. This allows me to determine which monitor the mouse is on, which is almost certainly the monitor holding the taskbar icon used to launch the application.

Electron: Is it possible to set the current window to be frameless?

I would like to be able to toggle between framed and frameless window in my Electron app, without needing to construct a new window. This is because this option is a different view than what would be initially loaded, therefore it would be nice if there is a way to change the current window to be frameless.
I have found window.setFullscreen() for toggling between full screen mode. I've not been able to find anything similar for frameless window. Is there any such method or workaround that I'm not seeing?
As the docs go, you enable or disable window frame at the time of creation of browser window. After that, there are no methods you can call to enable or disable frame. However, if you really really want that option, there may be a workaround. And a workaround, is well, a workaround.
Create 2 browser windows, one over the other. The first one being transparent window(with frame and click-through) and the second one being your content window(without frame).
Implement your custom solution to keep size and position of both the windows in sync. Use ipc to share data between the windows.
Toggle the visibility of the transparent browser window to show/hide frame.
Some relevant resources:
Creating frameless window : https://electronjs.org/docs/api/frameless-window#create-a-frameless-window
Creating transparent window : https://electronjs.org/docs/api/frameless-window#transparent-window

windows 10 UWP UI design for mobile device

I am working on windows 10 mobile app. If I design an UI for 5' device, it doesn't look good on 5.2' device. Also on emulators of different screen size show messed up UI. Is there any work around this? Or do I have to design it for every screen size?
Usually, please avoid to have fixed Width/Height for your controls. With a Grid layout, you can set columns/rows and place your controls inside each cells. This is a first level to adapt properly your interface. In addition, UWP provides AdaptiveTriggers if you want to adapt the layout based on the screen resolution (cf. https://channel9.msdn.com/Series/A-Developers-Guide-to-Windows-10/07) for additional information. Last but not least, please check Design&UI documention on https://developer.microsoft.com/en-us/windows/design.
The trick is with UWP that you can design for every screensize at once. It's just a responsive design you use (either HTML/CSS or XAML). But you have to use the right controls and settings.
Some guidance on how to design for various sizes can be found at the MSDN design page.
To create a dynamic layout with XAML, see this article. There are various panel-types you can use to do the layout (see this article). But if you really want to build a responsive UI (or change it dramatically in various sizes) RelativePanel is your friend.

In Dreamweaver CS5, is it possible to detach design preview (to move to second monitor)

Is it possible to detach the design preview from the code view, for use on the second monitor?
If you don't like Split view (vertical or horizontal) you can put the code view portion on another monitor by using the Code Inspector (Window -> Code Inspector, or F10 on Windows, I think CMD+F10 on Mac ). The Code Inspector is a floating panel that you can place wherever you want. If you make changes in the Code Inspector you need to refresh the document, (F5 on Win and Mac) so that the updates will migrate over.
Beyond that you'll need to live with it unless you stretch Dreamweaver such that it spans 2 monitors and then use split view and adjust the split point.
When you working on localhost try this:
Monitor 1: dw code view
Monitor 2: Firefox with Auto Reload Add-on (Reload page automatically when selected local files are changed.)
You will have better results...

Resources