Skip to content

Commit

Permalink
Adding hook to configure additional options in Windows.
Browse files Browse the repository at this point in the history
This might fail if the VM is not prepared, so it is handling that scenario.
  • Loading branch information
tesonep committed Oct 7, 2021
1 parent e7b8327 commit 1abe32e
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/OSWindow-Core/OSWindowDriver.class.st
Expand Up @@ -108,6 +108,10 @@ OSWindowDriver class >> shutDown: quitting [
ifTrue: [ ActiveWorld := nil ]
]

{ #category : #events }
OSWindowDriver >> afterMainPharoWindowCreated: aWindow [
]

{ #category : #events }
OSWindowDriver >> afterSetWindowTitle: windowTitle onWindow: osWindow [
]
Expand Down
1 change: 1 addition & 0 deletions src/OSWindow-Core/OSWorldRenderer.class.st
Expand Up @@ -106,6 +106,7 @@ OSWorldRenderer >> doActivate [
attributes preferableDriver: driver.
osWindow := OSWindow createWithAttributes: attributes eventHandler: (OSWindowMorphicEventHandler for: world).

driver afterMainPharoWindowCreated: osWindow.
driver afterSetWindowTitle: Smalltalk image imageFile fullName onWindow: osWindow.

osWindow focus.
Expand Down
8 changes: 8 additions & 0 deletions src/OSWindow-SDL2/OSSDL2Driver.class.st
Expand Up @@ -43,6 +43,14 @@ OSSDL2Driver class >> isVMDisplayUsingSDL2 [
^ false
]

{ #category : #events }
OSSDL2Driver >> afterMainPharoWindowCreated: osWindow [

OSPlatform current sdlPlatform
afterMainPharoWindowCreated: osWindow

]

{ #category : #events }
OSSDL2Driver >> afterSetWindowTitle: windowTitle onWindow: osWindow [

Expand Down
6 changes: 6 additions & 0 deletions src/OSWindow-SDL2/SDLAbstractPlatform.class.st
Expand Up @@ -13,6 +13,12 @@ Class {
#category : #'OSWindow-SDL2-Bindings'
}

{ #category : #operations }
SDLAbstractPlatform >> afterMainPharoWindowCreated: aOSSDLWindow [

self subclassResponsibility
]

{ #category : #operations }
SDLAbstractPlatform >> afterSetWindowTitle: aString onWindow: aOSSDLWindow [

Expand Down
6 changes: 6 additions & 0 deletions src/OSWindow-SDL2/SDLNullPlatform.class.st
Expand Up @@ -7,6 +7,12 @@ Class {
#category : #'OSWindow-SDL2-Bindings'
}

{ #category : #operations }
SDLNullPlatform >> afterMainPharoWindowCreated: aOSSDLWindow [


]

{ #category : #operations }
SDLNullPlatform >> afterSetWindowTitle: aString onWindow: aOSSDLWindow [
]
Expand Down
5 changes: 5 additions & 0 deletions src/OSWindow-SDL2/SDLOSXPlatform.class.st
Expand Up @@ -7,6 +7,11 @@ Class {
#category : #'OSWindow-SDL2-Bindings'
}

{ #category : #operations }
SDLOSXPlatform >> afterMainPharoWindowCreated: aOSSDLWindow [

]

{ #category : #operations }
SDLOSXPlatform >> afterSetWindowTitle: aString onWindow: aOSSDLWindow [

Expand Down
18 changes: 18 additions & 0 deletions src/OSWindow-SDL2/SDLWindowsPlatform.class.st
Expand Up @@ -7,6 +7,24 @@ Class {
#category : #'OSWindow-SDL2-Bindings'
}

{ #category : #'as yet unclassified' }
SDLWindowsPlatform class >> enableDebugWindowMenu: hwnd [

self ffiCall: #(int enableDebugWindowMenu(void* hwnd)) module: 'PharoVMCore.dll'
]

{ #category : #operations }
SDLWindowsPlatform >> afterMainPharoWindowCreated: aOSSDLWindow [

| sdlWindowInfo handle |
[ sdlWindowInfo := aOSSDLWindow backendWindow getWMInfo.
handle := sdlWindowInfo info win window.

self class enableDebugWindowMenu: handle ]
onErrorDo: [
"There was an error installing the support for debug Window, the VM is not new enough." ].
]

{ #category : #operations }
SDLWindowsPlatform >> afterSetWindowTitle: aString onWindow: aOSSDLWindow [
]
Expand Down

0 comments on commit 1abe32e

Please sign in to comment.