Skip to content
Permalink
Browse files

SceneryBase: Make xinitThreads() static for better customisation

  • Loading branch information...
skalarproduktraum committed Mar 13, 2019
1 parent f8ad0c1 commit 748afbb958b1fa18cb1ebe26cf55bb98c042d111
Showing with 11 additions and 4 deletions.
  1. +11 −4 src/main/kotlin/graphics/scenery/SceneryBase.kt
@@ -98,10 +98,8 @@ open class SceneryBase @JvmOverloads constructor(var applicationName: String,
}

init {
if(Platform.get() == Platform.LINUX) {
logger.debug("Running XInitThreads")
XLib.INSTANCE.XInitThreads()
}
// will only be called on Linux, and only if it hasn't been called before.
xinitThreads()
}

/**
@@ -420,6 +418,7 @@ open class SceneryBase @JvmOverloads constructor(var applicationName: String,

companion object {
private val logger by LazyLogger()
private var xinitThreadsCalled: Boolean = false

/**
* Returns the process ID we are running under.
@@ -450,5 +449,13 @@ open class SceneryBase @JvmOverloads constructor(var applicationName: String,
demoDir
}
}

@JvmStatic fun xinitThreads() {
if(Platform.get() == Platform.LINUX && xinitThreadsCalled == false) {
logger.debug("Running XInitThreads")
XLib.INSTANCE.XInitThreads()
xinitThreadsCalled = true
}
}
}
}

0 comments on commit 748afbb

Please sign in to comment.
You can’t perform that action at this time.