react-x11 2.8.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-x11",
3
- "version": "2.8.0",
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.5.1",
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/app.js CHANGED
@@ -612,9 +612,15 @@ export class CocoaApp {
612
612
  );
613
613
  }
614
614
 
615
- _tickFrames() {
615
+ /**
616
+ * Run every frame that is due at `now`. The pump tick and the frame
617
+ * timer read the clock; a test names the moment, so that what a tick
618
+ * decides is a fact about that moment and not about how long the test
619
+ * took to ask — a shared runner stalls for milliseconds between two
620
+ * lines.
621
+ */
622
+ _tickFrames(now = performance.now()) {
616
623
  if (!this._rafQueue.length) return;
617
- const now = performance.now();
618
624
  // Each window keeps its own clock, so a window on a 120Hz panel paints
619
625
  // every refresh while one on a 60Hz monitor paints every other pump
620
626
  // tick. Decided once per clock per tick: every frame a window queued
@@ -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
@@ -10473,8 +10473,20 @@ export class WindowNode extends Scrollable(Node) {
10473
10473
  * and advertising lazily would race sources that cache the window list
10474
10474
  * at drag start. A window with no registered drop targets answers "not
10475
10475
  * accepting" once per entry instead (DropSession).
10476
+ *
10477
+ * The one exception is a `<popup dragPreview>`. It follows the pointer,
10478
+ * so for the whole gesture it is the frontmost window under it, and it
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. 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.
10476
10487
  */
10477
10488
  _initDnd() {
10489
+ if (this.props.dragPreview) return;
10478
10490
  const wnd = this.window;
10479
10491
  const X = this.app?.X;
10480
10492
  // A backend with drop machinery of its own (the cocoa backend's
@@ -436,8 +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, so a `<popup dragPreview>` can follow the
440
- * pointer without swallowing its own drag. See `useDragSource`.
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`.
441
445
  */
442
446
  dragPreview?: boolean;
443
447
  /**