electron window - alwaysontop but not above other apps - electron

electron setAlwaysOnTop always put the window above ALL apps, how can i make a window that is only always on top, relative to the other electron app windows

found a solution using parents:
let top = new BrowserWindow()
let child = new BrowserWindow({ parent: top })

Related

App Store subscriptions url works in iPhone Safari but in Xamarin Forms fails to connect to iTunes store

I am using a url that, in iPhone Safari, takes me to a list of my App Store subscriptions. However when I use Xamarin Forms WebView to display that same url in my iOS solution, it wrongly displays another page entirely. The url is:
https://apps.apple.com/account/subscriptions
My code is simply:
webView = new WebView
{
Margin = new Thickness ( 0D ),
Source = "https://apps.apple.com/account/subscriptions",
WidthRequest = Bounds.Width,
HeightRequest = Bounds.Height
};
stackLayout = new StackLayout
{
Margin = new Thickness ( 0D ),
Padding = new Thickness ( 0D ),
WidthRequest = Bounds.Width,
HeightRequest = Bounds.Height,
Children = { webView }
};
Content = stackLayout;
Is it possible to get around this problem (for example in native iOS code), or is it simply a matter of Safari having integrations that the underlying native WkWebView does not?
Note: In iPhone Safari, the content is essentially the same as when I go to iPhone Settings > Profile picture > Subscriptions. However in WebView, I get an iTunes page saying "Connecting to the iTunes Store" (it never does), followed by "If you don't have iTunes, download it for free. If you have iTunes and it doesn't open automatically, try opening it from your dock or Windows taskbar".
Fwiw the url was supplied by the RevenueCat API.

swift ios macCatalyst app does not load some views on startup on macOS Monterey

since the release of the new macOS Moterey operating system (12) my MacCatalyst application does not load some views at startup until I resize the window or change focus.
If I look at XCode's Debug View Hierarchy these views are not present.
If, on the other hand, I use the classic debug (while they are not shown) it turns out that they have the correct frame (origin and size), superviews and window.
To show them I have to resize the window (manually, using the mouse) or remove the focus from the app (for example by clicking on another window and then clicking the app window again).
Only after doing one of these two things are the views loaded.
Has anyone experienced the same behavior?
The application is developed in Swift only with UIKit and various Storyboards (without SwiftUI).
Thanks a lot to everyone.
I understand what happens. 
If it can be useful to anyone ... 
I use custom margins for my UIViewControllers. To calculate a margin, I use the minimum width of a scene as a variable.
I take this value in this way: 
var minSceneWidth:CGFloat = 400
scenes.forEach { windowScene in
if let w = windowScene.sizeRestrictions?.minimumSize.width {
if minSceneWidth > w {
minSceneWidth = w
}
}
}
Since the latest version of macOS the value "minimumSize.width" seems to be also "0" and this is not good for the calculation of my margins. 
Thank you all.

how to replace electron js default icon with custom icon from window title

I am trying to replace electron js default icon with custom icon from window title. As I am new to electron js, need help regarding this.
please refer below image
View icon
In main.js in your function where you create the window add
mainWindow = new BrowserWindow({
icon: './pathTo/myIcon.ico' // <-- this line
});
to your create Window function. Of course you have to provide a valid windows icon on this path.

electron change position of dev menu

Is it possible to make my devTools dock to bottom by default?
I am completely new at electron, and this project took me 8 minutes to set up so excuse my design.
what i want
contents.openDevTools([options])
options Object (optional)
mode String - Opens the devtools with specified dock state, can be right, bottom, undocked, detach. Defaults to last used dock state. In undocked mode it's possible to dock back. In detach mode it's not.
So in your code in the Main process, it should be something like this
mainWindow.webContents.openDevTools({ mode: 'bottom' })
webContents API
This can be eaisly done as follows
window.webContents.openDevTools({ mode: "bottom"});
or as follows
mainWindow.webContents.openDevTools({ mode: 'detach' });
use { mode: 'undocked' } , then you can see the different options to put you devtool when it's launched, but maybe you can't use some mode, like bottom or right. good luck!

How can I update an electron BrowserWindow icon after the window is already opened?

With the electron api, I can set the window's icon when calling the BrowserWindow constructor, like this:
mainWindow = new BrowserWindow({
icon: __dirname + '/electric-glowing-bear.png');
Unfortunately, I haven't been able to figure out how to update the icon after the fact. There seems to be a way to update the dock icon on Mac OS X, however, I am running Linux.
The purpose of this is so that I can 'badge' the icon with a number to indicate unread messages are waiting.
The only workaround I have found so far is to use a Tray icon, however, I would prefer to show the unread count in the dock / taskbar.
You can set BrowserWindow icon when creating windows at like this.
const {BrowserWindow} = require('electron')
let mainWindow = new BrowserWindow({icon: icon})
You can change BrowserWindow icon anytime like this.
mainWindow.setIcon(changeicon);
You can Taskbar icon overlay numbering anytime like this.
mainWindow.setOverlayIcon(overlayicon, description)
Windows overlay NativeImage - the icon to display on the bottom right corner of the taskbar icon. If this parameter is null, the overlay is cleared
description String - a description that will be provided to Accessibility screen readers
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user.
this should work as long as you have the appropriate files in place
const os = require('os'); // top of file
switch (os.platform()) {
case 'darwin':
mainWindow.setIcon('src/app/assets/icons/icon.icns');
break;
case 'win32':
mainWindow.setIcon('src/app/assets/icons/icon.ico');
break;
default:
mainWindow.setIcon('src/app/assets/icons/icon.png');
break;
}
Unfortunately this does not seem to be possible currently, at least not on Linux.

Resources