react-x11 2.8.1 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/cocoa/window.js +10 -0
- package/src/nodes.js +7 -5
- package/src/types/elements.d.ts +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-x11",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.2",
|
|
4
4
|
"description": "react renderer with X11 as a target",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"yoga-layout": "^3.2.1"
|
|
99
99
|
},
|
|
100
100
|
"optionalDependencies": {
|
|
101
|
-
"@windowkit/appkit": "^0.
|
|
101
|
+
"@windowkit/appkit": "^0.6.0",
|
|
102
102
|
"dbus-native": "^0.15.1",
|
|
103
103
|
"x11-dri": "^0.7.0"
|
|
104
104
|
},
|
package/src/cocoa/window.js
CHANGED
|
@@ -68,6 +68,16 @@ export class CocoaWindow {
|
|
|
68
68
|
attributes.visual !== undefined || attributes.transparent;
|
|
69
69
|
this._transparentWindow = Boolean(transparent);
|
|
70
70
|
if (transparent) options.opaque = false;
|
|
71
|
+
// A `<popup dragPreview>` follows the pointer, so for the whole gesture
|
|
72
|
+
// it is the window the window server finds under it — and AppKit does
|
|
73
|
+
// not look past a window that registered no dragged types: the drag
|
|
74
|
+
// simply has no destination, and the window beneath never hears of it.
|
|
75
|
+
// Transparent to the pointer, the preview is passed over and the hit
|
|
76
|
+
// reaches what it covers (#488; @windowkit/appkit >= 0.6.0, an older
|
|
77
|
+
// bridge ignores the option). The drop side is excluded separately:
|
|
78
|
+
// nodes.js `_initDnd` gives a preview no DropSession and registers
|
|
79
|
+
// nothing.
|
|
80
|
+
if (attributes.dragPreview) options.ignoresMouseEvents = true;
|
|
71
81
|
// The root layer's background is the "what newly exposed area shows"
|
|
72
82
|
// attribute an X window has — worth seeding on an opaque window so a
|
|
73
83
|
// resize flashes the right colour. On a transparent one it would sit
|
package/src/nodes.js
CHANGED
|
@@ -10477,11 +10477,13 @@ export class WindowNode extends Scrollable(Node) {
|
|
|
10477
10477
|
* The one exception is a `<popup dragPreview>`. It follows the pointer,
|
|
10478
10478
|
* so for the whole gesture it is the frontmost window under it, and it
|
|
10479
10479
|
* must never be what the drag is over. Where react-x11 picks the target
|
|
10480
|
-
* itself (src/dnd.js `topLevelAt`) it is skipped by name
|
|
10481
|
-
* picks
|
|
10482
|
-
*
|
|
10483
|
-
*
|
|
10484
|
-
*
|
|
10480
|
+
* itself (src/dnd.js `topLevelAt`) it is skipped by name. Where the OS
|
|
10481
|
+
* picks, registering nothing is not enough: AppKit finds the window
|
|
10482
|
+
* under the pointer first and does not look past one with no dragged
|
|
10483
|
+
* types — the drag then has no destination at all — so the cocoa window
|
|
10484
|
+
* is made transparent to the pointer instead (src/cocoa/window.js,
|
|
10485
|
+
* `ignoresMouseEvents`, #488). A preview still gets none of this: no
|
|
10486
|
+
* session, no registry entry, no property, nothing to refuse with.
|
|
10485
10487
|
*/
|
|
10486
10488
|
_initDnd() {
|
|
10487
10489
|
if (this.props.dragPreview) return;
|
package/src/types/elements.d.ts
CHANGED
|
@@ -436,11 +436,12 @@ export interface WindowProps
|
|
|
436
436
|
xi2?: boolean | 'auto';
|
|
437
437
|
/**
|
|
438
438
|
* Mark this window as a drag preview: the drag router never treats it as
|
|
439
|
-
* the window under the pointer,
|
|
440
|
-
* the cocoa backend
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
*
|
|
439
|
+
* the window under the pointer, it is never a drop destination, and on
|
|
440
|
+
* the cocoa backend — where the window server picks the window under the
|
|
441
|
+
* pointer — it is made transparent to the pointer, so a drop reaches the
|
|
442
|
+
* window beneath it. A `<popup dragPreview>` can therefore follow the
|
|
443
|
+
* pointer without swallowing its own drag. Read when the window is
|
|
444
|
+
* created. See `useDragSource`.
|
|
444
445
|
*/
|
|
445
446
|
dragPreview?: boolean;
|
|
446
447
|
/**
|