Hiding Title in a Fullscreen mode?

The way I handle this in my Android games is to call the following line in the onCreate() of my Activity requestWindowFeature(Window.FEATURE_NO_TITLE); I can then turn the full screen capability off and on using the following code in my activity class (usually called from a menu option) (the m_contentView variable is the view from findViewById() … 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

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

How to stop a requestAnimationFrame recursion/loop?

One way to start/stop is like this var requestId; function loop(time) { requestId = undefined; … // do stuff … start(); } function start() { if (!requestId) { requestId = window.requestAnimationFrame(loop); } } function stop() { if (requestId) { window.cancelAnimationFrame(requestId); requestId = undefined; } } Working example: const timeElem = document.querySelector(“#time”); var requestId; function loop(time) … Read more