mirror of https://github.com/adamdruppe/arsd.git
more macintrash fixes
This commit is contained in:
parent
7ae8dc137f
commit
d0b857578c
|
|
@ -2367,12 +2367,19 @@ class SimpleWindow : CapableOfHandlingNativeEvent, CapableOfBeingDrawnUpon {
|
||||||
nativeMapping[cast(void*) nativeWindow] = this;
|
nativeMapping[cast(void*) nativeWindow] = this;
|
||||||
|
|
||||||
beingOpenKeepsAppOpen = false;
|
beingOpenKeepsAppOpen = false;
|
||||||
|
useDirectDraw = true;
|
||||||
|
|
||||||
if(nativeWindow)
|
if(nativeWindow) {
|
||||||
|
version(OSXCocoa)
|
||||||
|
CapableOfHandlingNativeEvent.nativeHandleMapping[cast(void*) nativeWindow] = this;
|
||||||
|
else
|
||||||
CapableOfHandlingNativeEvent.nativeHandleMapping[nativeWindow] = this;
|
CapableOfHandlingNativeEvent.nativeHandleMapping[nativeWindow] = this;
|
||||||
|
}
|
||||||
_suppressDestruction = true; // so it doesn't try to close
|
_suppressDestruction = true; // so it doesn't try to close
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool useDirectDraw;
|
||||||
|
|
||||||
/++
|
/++
|
||||||
Used iff [WindowFlags.managesChildWindowFocus] is set when the window is created.
|
Used iff [WindowFlags.managesChildWindowFocus] is set when the window is created.
|
||||||
The delegate will be called when the window manager asks you to take focus.
|
The delegate will be called when the window manager asks you to take focus.
|
||||||
|
|
@ -11162,6 +11169,9 @@ void runInWorkerThread(T)(T delegate(Task) work, void delegate(T) uponCompletion
|
||||||
interface CapableOfHandlingNativeEvent {
|
interface CapableOfHandlingNativeEvent {
|
||||||
NativeEventHandler getNativeEventHandler();
|
NativeEventHandler getNativeEventHandler();
|
||||||
|
|
||||||
|
version(OSXCocoa)
|
||||||
|
/*private*//*protected*/ __gshared CapableOfHandlingNativeEvent[void*] nativeHandleMapping; // to avoid typeinfo problems
|
||||||
|
else
|
||||||
/*private*//*protected*/ __gshared CapableOfHandlingNativeEvent[NativeWindowHandle] nativeHandleMapping;
|
/*private*//*protected*/ __gshared CapableOfHandlingNativeEvent[NativeWindowHandle] nativeHandleMapping;
|
||||||
|
|
||||||
version(X11) {
|
version(X11) {
|
||||||
|
|
@ -13456,9 +13466,12 @@ version(X11) {
|
||||||
|
|
||||||
Drawable buffer = None;
|
Drawable buffer = None;
|
||||||
if(auto sw = cast(SimpleWindow) this.window) {
|
if(auto sw = cast(SimpleWindow) this.window) {
|
||||||
|
if(sw.useDirectDraw)
|
||||||
|
goto direct_draw;
|
||||||
buffer = sw.impl.buffer;
|
buffer = sw.impl.buffer;
|
||||||
this.destiny = cast(Drawable) window;
|
this.destiny = cast(Drawable) window;
|
||||||
} else {
|
} else {
|
||||||
|
direct_draw:
|
||||||
buffer = cast(Drawable) window;
|
buffer = cast(Drawable) window;
|
||||||
this.destiny = None;
|
this.destiny = None;
|
||||||
}
|
}
|
||||||
|
|
@ -18645,6 +18658,8 @@ struct Visual
|
||||||
DON'T FORGET TO MARK THE CLASSES `extern`!! can cause "unrecognized selector sent to class" errors if you do.
|
DON'T FORGET TO MARK THE CLASSES `extern`!! can cause "unrecognized selector sent to class" errors if you do.
|
||||||
+/
|
+/
|
||||||
|
|
||||||
|
import core.attribute;
|
||||||
|
|
||||||
private __gshared AppDelegate globalAppDelegate;
|
private __gshared AppDelegate globalAppDelegate;
|
||||||
|
|
||||||
extern(Objective-C)
|
extern(Objective-C)
|
||||||
|
|
@ -18730,7 +18745,8 @@ struct Visual
|
||||||
|
|
||||||
if (sw.onDestroyed !is null) try { sw.onDestroyed(); } catch (Exception e) {} // sorry
|
if (sw.onDestroyed !is null) try { sw.onDestroyed(); } catch (Exception e) {} // sorry
|
||||||
SimpleWindow.nativeMapping.remove(window);
|
SimpleWindow.nativeMapping.remove(window);
|
||||||
CapableOfHandlingNativeEvent.nativeHandleMapping.remove(cast(NSWindow) window);
|
// FIXME: this makes a ref to typeinfo apparently
|
||||||
|
CapableOfHandlingNativeEvent.nativeHandleMapping.remove(window);
|
||||||
|
|
||||||
bool anyImportant = false;
|
bool anyImportant = false;
|
||||||
foreach(SimpleWindow w; SimpleWindow.nativeMapping)
|
foreach(SimpleWindow w; SimpleWindow.nativeMapping)
|
||||||
|
|
@ -19499,6 +19515,7 @@ version(OSXCocoa) {
|
||||||
// window.release(); // closing the window does this automatically i think
|
// window.release(); // closing the window does this automatically i think
|
||||||
}
|
}
|
||||||
void closeWindow() {
|
void closeWindow() {
|
||||||
|
if(window)
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue