1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-07-01 17:57:45 +02:00

Merge pull request #367 from landswellsong/osx-terminal-xtra-fix

Correctly operational from OSX terminals
This commit is contained in:
JFreegman 2015-11-25 03:42:55 -05:00
commit 88270827a9

View File

@ -271,6 +271,11 @@ int init_xtra(drop_callback d)
Xtra.terminal_window = focused_window_id(); Xtra.terminal_window = focused_window_id();
/* OSX: if focused window is 0, it means toxic is ran from
* native terminal and not X11 terminal window, silently exit */
if (!Xtra.terminal_window)
return 0;
{ {
/* Create an invisible window which will act as proxy for the DnD operation. */ /* Create an invisible window which will act as proxy for the DnD operation. */
XSetWindowAttributes attr = {0}; XSetWindowAttributes attr = {0};
@ -343,7 +348,7 @@ int init_xtra(drop_callback d)
void terminate_xtra() void terminate_xtra()
{ {
if (!Xtra.display) return; if (!Xtra.display || !Xtra.terminal_window) return;
XEvent terminate = { XEvent terminate = {
.xclient = { .xclient = {