Hi Kevin,
I'm bringing this back to wine-devel. Please CC the list unless you intend to take things private, in which case please say so.
On May 10, 2013, at 6:48 PM, Kevin Eaves wrote:
I should have made everything clear, sorry. It was for personal use, so it's pretty nasty, but works great. The only real problem is with user32. Everything else is easy to clean up and get working with Wine properly without any issues. Just wanted to show that.
Sure, that's what I figured.
On May 9, 2013, at 9:56 PM, Ken Thomases wrote:
The fullscreen button appears if a main window is resizable.
We may want to narrow this down a bit. For example, the common file dialogs are resizable, but probably shouldn't be full-screen-enabled. Perhaps no owned window should be.
Only windows in the windows cycle should be fullscreen enabled. If the window can be manually moved to its own space, then it should be able to go fullscreen. No dialogs are enabled. These follow the main window to spaces. If in Cocoa fullscreen, the new window automatically opens fullscreen in its own space. Everything works just like Mac applications with this setting.
Ah, I failed to notice before that the use of NSWindowCollectionBehaviorFullScreenPrimary was only in the same code path as NSWindowCollectionBehaviorParticipatesInCycle. Yes, that makes sense.
From cocoa_window.m.diff:
+#import <Cocoa/Cocoa.h>
Was that actually needed? cocoa_window.h already imports <AppKit/AppKit.h>.
...
if (style & NSResizableWindowMask)
[[self standardWindowButton:NSWindowZoomButton] setEnabled:!self.disabled];
These should have not been included in the diff. It's unrelated to Cocoa fullscreen, however, the zoom button is currently bugged. It is not disabled when the window is disabled. To reproduce the problem: launch regedit, open the import window, and click the zoom button on the main window. I sent a patch for it.
I'm not seeing that problem happen here. Mind you, I'm currently testing on 10.6. I'll have to run some tests on 10.7+ tomorrow.
I find it improbable that removing NSResizableWindowMask from the style doesn't disable the zoom button. That style is the only thing which enables the zoom button to begin with. In other words, in a normal Mac app, one would not need to disable the zoom button separately.
if (captured || fullscreen)
if (captured || (fullscreen && !(normalStyleMask & NSResizableWindowMask)))
You're trying to distinguish between a window that was full-screened at the instigation of the Windows program versus one which has been full-screened by Cocoa, right? Hmm. I think we need a better technique to determine that. I agree that it's not likely the Windows program would make its window full-screen while still allowing it to be resized but it feels wrong to assume that.
Also, I think we can entirely avoid setting the window level for windows that have been Cocoa full-screened. Setting the window level is mostly about relationship to other windows, but a Cocoa full-screen window should be on a space by itself, shouldn't it?
else if ([self styleMask] & NSFullScreenWindowMask)
level = NSMainMenuWindowLevel + 2;
I'm not following why Cocoa full-screened windows should be at +2 vs. +1.
The window levels are automatically adjusted and the menu is in a hover state. We need to prevent the menu from being hidden, and hide the menu if the Windows program goes fullscreen while in Cocoa fullscreen (+1 doesn't cut it).
I'm going to have to do some testing to understand this, too. NSMainMenuWindowLevel should be in the same level as the menu (meaning could be above or below due to normal window ordering operations). NSMainMenuWindowLevel + 1 should always be above the menu, regardless. NSMainMenuWindowLevel + 2 should not be necessary. But maybe something weird is going on.
Also, if the Windows program changes a window from resizable to non-resizable, then we should probably pull the window out of Cocoa fullscreen. The Windows program _may_ have intended to make the window full-screen but we can't know that. It may simply be changing the window style for some other purpose, and that may make it no longer a candidate for Cocoa full-screen mode.
- (NSSize)window:(NSWindow *)window willUseFullScreenContentSize:(NSSize)proposedSize
- {
return NSMakeSize(proposedSize.width, proposedSize.height);
- }
Is this actually needed? I assume that's the default behavior when the delegate method is absent. (Also, if it is necessary, it can just return proposedSize without making a new size struct.)
This little gem will resize ANY window — non-resizable, disabled, a dialog box... Add this and poof!! There is no reason to ever disable Cocoa fullscreen. Mac applications don't so neither should Wine.
I disagree. Windows programs that are not expecting their window to resize (because they haven't made them resizable) can misbehave badly if the window does resize. Just because that didn't happen in your testing doesn't mean it won't.
As you mentioned in your original email, Cocoa full-screen is roughly akin to window resizing. So, it should be disabled if/when the window is made non-resizable.
I haven't tested this enough with non-resizable windows, but it is possible to resize any window.
I don't follow this. It is possible to resize any window even non-resizable ones? To what are you referring? Possible how? Do you mean specifically just with this full-screen patch?
I use this feature to resize a few non-resizable game windows. Maybe add a registry key to allow non-resizable windows to go fullscreen.
Perhaps.
Cheers, Ken
On May 12, 2013, at 1:12 PM, Ken Thomases wrote:
I'm not seeing that problem happen here. Mind you, I'm currently testing on 10.6. I'll have to run some tests on 10.7+ tomorrow.
I find it improbable that removing NSResizableWindowMask from the style doesn't disable the zoom button. That style is the only thing which enables the zoom button to begin with. In other words, in a normal Mac app, one would not need to disable the zoom button separately.
Looks like you sent a patch for this. The title is also empty when exiting borderless to titled, which can be fixed here.
Also, if the Windows program changes a window from resizable to non-resizable, then we should probably pull the window out of Cocoa fullscreen. The Windows program _may_ have intended to make the window full-screen but we can't know that. It may simply be changing the window style for some other purpose, and that may make it no longer a candidate for Cocoa full-screen mode.
Allowing Windows fullscreen in Cocoa fullscreen was never a very good idea. I did not want to force the window out, but a borderless window would not be allowed to enter Cocoa fullscreen, so it probably should not be there.
I disagree. Windows programs that are not expecting their window to resize (because they haven't made them resizable) can misbehave badly if the window does resize. Just because that didn't happen in your testing doesn't mean it won't.
As you mentioned in your original email, Cocoa full-screen is roughly akin to window resizing. So, it should be disabled if/when the window is made non-resizable.
I do not see the reason to disable buttons and make the windows non-resizable. Probably wrong here, but doesn't this just eliminate click-through, which is typical of Windows apps, because the Windows paradigm stinks?
I don't follow this. It is possible to resize any window even non-resizable ones? To what are you referring? Possible how? Do you mean specifically just with this full-screen patch?
It is possible to do anything we want with a window. The actual Windows program not freaking out is another story. Just pointing out that we are not limited.
On May 15, 2013, at 8:49 PM, Kevin Eaves wrote:
… The title is also empty when exiting borderless to titled, which can be fixed here.
Hmm, good catch. I'll have to check, but I suspect the window no longer remembers its title at that point. And the Mac driver doesn't currently store it anywhere else. So, we may need to do so in order to restore it.
Also, if the Windows program changes a window from resizable to non-resizable, then we should probably pull the window out of Cocoa fullscreen. The Windows program _may_ have intended to make the window full-screen but we can't know that. It may simply be changing the window style for some other purpose, and that may make it no longer a candidate for Cocoa full-screen mode.
Allowing Windows fullscreen in Cocoa fullscreen was never a very good idea. I did not want to force the window out, but a borderless window would not be allowed to enter Cocoa fullscreen, so it probably should not be there.
Yeah. It may make for a poor user experience to force the window out of Cocoa full-screen, especially if it's just going to go Windows full-screen right afterward, but I think it's probably necessary. I think it's a relatively rare occurrence, anyway.
I disagree. Windows programs that are not expecting their window to resize (because they haven't made them resizable) can misbehave badly if the window does resize. Just because that didn't happen in your testing doesn't mean it won't.
As you mentioned in your original email, Cocoa full-screen is roughly akin to window resizing. So, it should be disabled if/when the window is made non-resizable.
I do not see the reason to disable buttons and make the windows non-resizable. Probably wrong here, but doesn't this just eliminate click-through, which is typical of Windows apps, because the Windows paradigm stinks?
Well, that's how it works on Windows. And the X11 driver in Wine. And native Mac apps. (Open TextEdit. Its window has all the buttons enabled and can be resized. Open the modal Open dialog. The document window still has all its buttons and, on 10.6, the grow box, but they're disabled. On 10.7+, the resize cursors around the edge still show, but they're ineffective. I suppose we can achieve that same effect by not using the min and max sizes to prevent resize but do it by overriding -windowWillResize:toSize:, but I prefer it to be obviously not resizable.)
The main reason is that some Windows apps will probably freak out if their windows get resized, closed, or minimized when they're supposed to be disabled.
I don't follow this. It is possible to resize any window even non-resizable ones? To what are you referring? Possible how? Do you mean specifically just with this full-screen patch?
It is possible to do anything we want with a window. The actual Windows program not freaking out is another story. Just pointing out that we are not limited.
Sure, but Wine is aiming for compatibility with Windows apps, so the "not freaking out" thing is kind of a big deal. ;)
-Ken