NSWindow contentView not cover full window size – macOS & SwiftUI

I just used the following variant in AppDelegate, the content of ContentView and others can be any func applicationDidFinishLaunching(_ aNotification: Notification) { // Create the SwiftUI view that provides the window contents. let contentView = ContentView() .edgesIgnoringSafeArea(.top) // to extend entire content under titlebar // Create the window and set the content view. window = … Read more

Going fullscreen on secondary monitor

Extension method to Maximize a window to the secondary monitor (if there is one). Doesn’t assume that the secondary monitor is System.Windows.Forms.Screen.AllScreens[2]; using System.Linq; using System.Windows; namespace ExtendedControls { static public class WindowExt { // NB : Best to call this function from the windows Loaded event or after showing the window // (otherwise window … Read more

Win32: full-screen and hiding taskbar

Edit 2. There is even a better way for doing fullscreen, the chromium way, source taken from here: http://src.chromium.org/viewvc/chrome/trunk/src/ui/views/win/fullscreen_handler.cc?revision=HEAD&view=markup void FullscreenHandler::SetFullscreenImpl(bool fullscreen, bool for_metro) { ScopedFullscreenVisibility visibility(hwnd_); // Save current window state if not already fullscreen. if (!fullscreen_) { // Save current window information. We force the window into restored mode // before going fullscreen … Read more

Fullscreen API: Which events are fired?

I was using: $(document).on(‘webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange’, fn); It fires for Safari, Chrome, and Firefox (haven’t tested others). There seems to be a subtle difference in the resulting context between webkit and moz, element height and width are different. But the events fire, which is your question. Oh. And watch out for using alert(‘fs’) with … Read more

Easy way to hide system bar on Android ICS

After a lot of searching on the internet, I managed to get the System Bar to hide and appear in a 4.2 device using: To Hide: Runtime.getRuntime().exec(“service call activity 42 s16 com.android.systemui”); Or use 79 instead of 42 for API less than 14. You may also need to include the SET_DEBUG_APP permission, in which case … Read more

Chrome Fullscreen API

The API only works during user interaction, so it cannot be used maliciously. Try the following code: addEventListener(“click”, function() { var el = document.documentElement, rfs = el.requestFullscreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen ; rfs.call(el); });

Hide ICS back home task switcher buttons

pinxue is spot-on… you want SYSTEM_UI_FLAG_HIDE_NAVIGATION. Example: myView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); One thing to note, though, is that upon any (and I mean ANY) user interaction the navigation bar will be reshown. With Honeycomb the closest you can get is to go into “lights out” mode (now called “low profile”… SYSTEM_UI_FLAG_LOW_PROFILE ). This just makes the items on … Read more