1
0
mirror of https://github.com/lxsang/Diya-API.git synced 2024-12-26 19:38:22 +01:00

allow to set system resolution using the DIYA_RES environment variable

This commit is contained in:
Dany LE 2022-05-23 12:26:46 +02:00
parent 5058d62876
commit a8b89f19c5
3 changed files with 28 additions and 2 deletions

View File

@ -113,8 +113,23 @@ DiyaBoot >> render [
{ #category : #events }
DiyaBoot >> run [
self init.
self startx.
|envar arr|
envar := Smalltalk getenv:'DIYA_RES'.
arr := nil.
envar ifNotNil: [
arr := (envar splitOn: 'x') collect: [ :e| e asInteger ] .
arr size = 2 ifFalse:[
arr := nil.
]
].
arr
ifNil: [
self init.
self startx.
]
ifNotNil: [
self run: (arr at:1) @ (arr at: 2)
]
]
{ #category : #running }

View File

@ -0,0 +1,5 @@
Class {
#name : #DiyaRuntimeError,
#superclass : #DiyaError,
#category : #'Diya-Events'
}

View File

@ -0,0 +1,6 @@
Extension { #name : #SmalltalkImage }
{ #category : #'*Diya' }
SmalltalkImage >> getenv: key [
^ self ffiCall: #(char *getenv(const char *key)) module: LibC
]