Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabling-debug-window-in-windows-P10 #10130

Merged
merged 2 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/OSWindow-Core/OSWindowDriver.class.st
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ Class {
#category : #'OSWindow-SDL2-Bindings'
}

{ #category : #operations }
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