If the size of the full screen window is less than the size of the screen then a background pattern will be visible and the full screen window will cast a shadow. The result is a full screen App with a window that still provides an illusion of depth.
The first thing we need to do is create a
#define
that specifies the size of the border around our window.// Define the size of the border around the window #define BTS_WINDOW_BORDER 100
It's also a good idea to define a minimum size that is acceptable.
// Define the minimum acceptable size #define BTS_MIN_WIDTH 320 #define BTS_MIN_HEIGHT 240
Then we need to override the window delegate method
window:willUseFullScreenContentSize:proposedSize
and have it return our calculated window size.- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize {
The window size that we want to use is the proposed size plus the defined border.
// calculate the desired window...