react-x11 2.40.0 → 2.41.0

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.
@@ -99,6 +99,8 @@ export class Win32PaneWindow {
99
99
  this._recent = new Array(STALE_FRAMES - 1).fill(null);
100
100
  this._owesFull = true;
101
101
  this._drawn = false;
102
+ // a size from the host not yet presented (`_sized`)
103
+ this._owesSized = false;
102
104
 
103
105
  this.id = PANE_ID_BASE + nextPaneWindow++;
104
106
  this.windowId = this.id;
@@ -143,14 +145,23 @@ export class Win32PaneWindow {
143
145
  this._publish();
144
146
  const w = Math.max(1, Math.round(width * this.scale));
145
147
  const h = Math.max(1, Math.round(height * this.scale));
146
- if (w === this.width && h === this.height) return;
148
+ // The host sends the next rect when this one is painted (`pane-sized`,
149
+ // src/frame/index.js): one that changes nothing is painted already.
150
+ if (w === this.width && h === this.height) {
151
+ this._sized();
152
+ return;
153
+ }
147
154
  this.width = w;
148
155
  this.height = h;
149
- if (!this._native.paneResize(this._pane, w, h)) return;
156
+ if (!this._native.paneResize(this._pane, w, h)) {
157
+ this._sized();
158
+ return;
159
+ }
150
160
  // Fresh buffers, undefined contents — the same standing start the
151
161
  // constructor sets up, for the same reason.
152
162
  this._owesFull = true;
153
163
  this._recent.fill(null);
164
+ this._owesSized = true;
154
165
  this.emit('resize', {
155
166
  width: w,
156
167
  height: h,
@@ -161,6 +172,14 @@ export class Win32PaneWindow {
161
172
  });
162
173
  }
163
174
 
175
+ /** Tell the host the size it last sent is on screen, so it sends the
176
+ * newest it has come to since — rather than every size a drag passed
177
+ * through, one a frame, long after the drag. */
178
+ _sized() {
179
+ if (this.destroyed) return;
180
+ this.app._paneSend?.({ type: 'pane-sized' });
181
+ }
182
+
164
183
  /** Tell the host which buffer is this pane's, once there is a frame in it.
165
184
  * Idempotent on the far side — `Win32PaneHost.present` attaches the first
166
185
  * time and recognises the handle every time after. */
@@ -294,6 +313,10 @@ export class Win32PaneWindow {
294
313
  this._drawn = true;
295
314
  this._publish();
296
315
  }
316
+ if (this._owesSized) {
317
+ this._owesSized = false;
318
+ this._sized();
319
+ }
297
320
  }
298
321
 
299
322
  /** The frame is the ordinary paint walk, so it paints through core's