Skip to content

Commit

Permalink
Merge pull request #291 from OpenSmalltalk/krono/288-withImageSize
Browse files Browse the repository at this point in the history
prefer image's saved size over arbitrary defaults if unknown
  • Loading branch information
estebanlm authored Oct 7, 2018
2 parents 127f38f + 42e0db0 commit c8f5070
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 0 additions & 2 deletions platforms/iOS/vm/Common/Classes/sqSqueakAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ - (void) makeMainWindow {
windowBlock->handle = (__bridge void*) createdWindow;
windowBlock->context = nil;
windowBlock->updateArea = CGRectZero;
width = (usqInt) ioScreenSize() >> 16;
height = ioScreenSize() & 0xFFFF;

setSavedWindowSize( (width << 16) |(height & 0xFFFF));
windowBlock->width = width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ - (double) ioSceenScaleFactor {
}

- (sqInt) ioScreenSize {
return (10 << 16) | (10 & 0xFFFF); /* w is high 16 bits; h is low 16 bits */
extern sqInt getSavedWindowSize(void); //This is VM Callback
sqInt savedSize = getSavedWindowSize();
return savedSize ? savedSize : (64 << 16) | (64 & 0xFFFF); /* w is high 16 bits; h is low 16 bits */
}

- (sqInt) ioScreenDepth {
Expand Down
8 changes: 4 additions & 4 deletions platforms/iOS/vm/Common/Classes/sqSqueakScreenAndWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ - (sqInt) ioScreenSize {
sqInt w, h;

#if BUILD_FOR_OSX
NSRect screenSize = [gDelegateApp.mainView bounds];
NSRect screenSize = [gDelegateApp.mainView bounds];
#else
CGRect screenSize = [gDelegateApp.mainView bounds];
CGRect screenSize = [gDelegateApp.mainView bounds];
#endif

w = (sqInt) screenSize.size.width;
h = (sqInt) screenSize.size.height;
w = (sqInt) screenSize.size.width;
h = (sqInt) screenSize.size.height;

return (w << 16) | (h & 0xFFFF); /* w is high 16 bits; h is low 16 bits */

Expand Down
4 changes: 1 addition & 3 deletions platforms/iOS/vm/OSX/sqMacV2Window.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ void makeMainWindow(void) {
width = (unsigned) getSavedWindowSize() >> 16;
height = getSavedWindowSize() & 0xFFFF;
windowBlock = AddWindowBlock();
windowBlock-> handle = gDelegateApp.window;
windowBlock->handle = gDelegateApp.window;
windowBlock->context = nil;
windowBlock->updateArea = CGRectZero;
width = (usqInt) ioScreenSize() >> 16;
height = ioScreenSize() & 0xFFFF;

setSavedWindowSize( (width << 16) |(height & 0xFFFF));
windowBlock->width = width;
Expand Down
4 changes: 3 additions & 1 deletion platforms/iOS/vm/OSX/sqSqueakMainApplication+screen.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ - (sqInt) ioScreenSize {
sqInt w, h;
sqInt browserGetWindowSize(void);
void makeMainWindow(void);
extern sqInt getSavedWindowSize(void); //This is VM Callback
sqInt getCurrentIndexInUse(void);
extern BOOL gSqueakExplicitWindowOpenNeeded;
sqInt savedSize = getSavedWindowSize();

if (gSqueakHeadless && !browserActiveAndDrawingContextOk())
return ((16 << 16) | 16);
return savedSize ? savedSize : ((64 << 16) | 64);

if (browserActiveAndDrawingContextOkAndNOTInFullScreenMode())
return browserGetWindowSize();
Expand Down

0 comments on commit c8f5070

Please sign in to comment.