fix: widgets disappears after display orientation change & saving profile in osw tool

This commit is contained in:
TrueZhuanjia
2025-07-25 20:18:43 +08:00
parent ab7ccc7732
commit 0df5135f0b
@@ -243,7 +243,10 @@
selector: @selector(handleReturnToForeground)
name: UIApplicationDidBecomeActiveNotification
object: nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(deviceOrientationDidChange) // handle orientation change since i made portrait mode available
name:UIDeviceOrientationDidChangeNotification
object:nil];
OnScreenWidgetView.editMode = true;
[self handleMissingToolBarIcon:toolbarRootView];
@@ -256,6 +259,13 @@
[OSCProfilesManager setOnScreenWidgetViewsSet:self.onScreenWidgetViews]; // pass the keyboard button dict to profiles manager
}
- (void)deviceOrientationDidChange{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
sleep(1);
[OSCProfilesManager setOnScreenWidgetViewsSet:self.onScreenWidgetViews]; // pass the keyboard button dict to profiles manager
});
}
/* fades the 'Undo Button' in or out depending on whether the user has any OSC layout changes to undo */
- (void) OSCLayoutChanged {
if ([self.layoutOSC.layoutChanges count] > 0) {