Problems after update to Mojave

Last week I updated to Mojave and since that moment I encounter all kind of problems. These are very various like unable to resize windows, a canvas that doesn’t react as it should ect… Old projects work fine, but if I recompile them I have these problems.
Is this known problem?

Nope. Not here. I got all sorts of other fun with Mojave but nothing like you describe.

First thing I would suggest is to do a clean install. In the recent years, I’ve witnessed a whole bunch of issues, many graphic issues that go away with a clean install, which leads me to conclude that Apple’s internet installer fails to correctly update all the drivers that are needed.

iMore has done an article on how to do this. However, I would add that it’s easier if you use Time Machine, you simply make sure that you have a complete Time Machine backup first, then once it’s reinstalled, it will offer the option to restore from Time Machine. This will bring all your applications and documents into the clean OS. https://www.imore.com/how-do-clean-install-macos

I’ve also found that if you stick with an OS version for a long time, repeating this process once a year, seems to reduce the crashfest that modern macOS can become.

p.s. Before you install any new macOS version you should use a different backup disk and something like Carbon Copy Cloner, to clone your drive. This way if you run into major issues, you can easily revert back to a known solid version of the macOS.

Thank you Sam for your suggestions. I have a Time Machine running. But first I am going to test it on a laptop.

Since I left Apple, I started to backup my hard disk, format (deep format: the one that takes hours to do, not minutes), then install the new OS, then install my applications from the original (not from a backup copy).

And doing that does not allow me to install newer OS (I still use El Capitan). But this is a different issue.

The clean install didn’t do the trick, Sam. But thanks anyway.

The problem is if I use a window without a header, I can resize the window one time and then it loses focus and you can’t get the focus back.
It worked perfectly without a header until the update.

This is the code in the open-event of the window.


//no header
dim newStyle As UInt32 = 8
soft declare sub setStyleMask lib "Cocoa.framework" selector "setStyleMask:" (id As Ptr, mask As UInt32)

//  The windowType is Document and when I don't call setStyleMask it is working. 
//  When I change the windowType to Plainbox it never works.

setStyleMask(Ptr(self.Handle), newStyle)

Have you looked in Apple’s docs to see if that StyleMask works in Mojave?

Stylemask does work with Mojave… the only docs I can find that reference issues have to do with the DEFER option

I would suspect a “Document Window” gets a stylemask of 0x0F
[titled / closable / miniaturiazble / resizeable ] [ 1 / 2 / 4 / 8]

8 [resizeable] alone would remove the titlebar (making it a “plain box”]

what exactly are you trying to do? and how does a normal “plain box” not work for you?

and you ARE using 10.6 or later?
also it would depend on how Xojo is creating the window in the first place… if is a TRUE NSWindow they should not be an issue I can see.

From the Xcode docs

[quote]
Some styleMask changes will cause the view hierarchy to be rebuilt, since there is a different subclass for the top level view of a borderless window than for the top level view of a titled window. [/quote]

  1. Always try to either use the actual OS constant name (NSWindowStyleMaskResizable) or make a comment from it. There’s nothing like coming back to code and going what the heck is 8!
  1. Mask should be a UInteger as the OS uses “NSUInteger” for this, so on 64-Bit you’re only passing 32-Bits, it still works now, but might not in the future.
  1. Normally with Style masks, you use bitwise.or with the current style mask of the window and then set that back.

In order to accomplish this with the Vibrant Aqua (macOS 10.10 +), I would suggest that you try an amalgamation of things instead.

[code]NSWindowTitleVisibility( me.handle ) = NSWIndowTitle.Hidden
NSWindowTitleBarAppearsTransparent( me.handle ) = true

NSWindowStyleMask( me.handle ) = bitwise.bitOr( NSWindowStyleMask( me.handle ), NSWindowStyleMaskFullSizeContentView )[/code]
This code is taken from my current library, but you can find alternatives in the Retina Kit, MBS and other collections. This will give you a window, with no titlebar, but still keeping the widgets and is resizable.

Thank you all for your contributions.

I got the styleMask solution from this discussion.
https://forum.xojo.com/2625-plain-box-that-globally-stays-in-foreground/0

It always worked for me and I can’t remember why I didn’t choose the Plainbox window type.
Now Plainbox seems to be working for me when the Maximize button = true.

what I am trying to figure out is how one would use stylemask (or something else) to create a narrow titlebar as seen in floating windows.

In the macOS world, things so rapidly, you should use 5 year code with caution. In the last few years, I’ve even seen them introduce something one year, only to replace it within two years.

would you care to expand on this statement? you seem to be inferring that “stylemask” is (or will soon be) deprecated, but I can find nothing that indicates any such thing… As a matter of fact almost all the documentation I can find on NSWINDOW talks quite a bit about using it

Why wouldn’t you just use a floating window?

because that wasn’t my question :slight_smile:

Thank you Sam, I declared styleMask as UInt64 and everything is working fine now.

To Greg and Dave I say that if you read my post well you find out that I never want to have a narrow titlebar, but a window WITHOUT a titlebar. My choice to use a Document type with the styleMask solution instead of a Plainbox was made years ago. I can’t recall my motivation.

I never said or inferred you did… I was asking what it took to alter an NSWINDOW in that manner