File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ class Window
40
40
41
41
protected bool $ focusable = true ;
42
42
43
+ protected bool $ focused = false ;
44
+
43
45
protected bool $ hasShadow = true ;
44
46
45
47
protected bool $ frame = true ;
@@ -282,4 +284,13 @@ public function afterOpen(callable $cb): static
282
284
283
285
return $ this ;
284
286
}
287
+
288
+ public function fromRuntimeWindow (object $ window ): static
289
+ {
290
+ foreach ($ window as $ key => $ value ) {
291
+ $ this ->{$ key } = $ value ;
292
+ }
293
+
294
+ return $ this ;
295
+ }
285
296
}
Original file line number Diff line number Diff line change @@ -30,9 +30,22 @@ public function hide($id = null)
30
30
]);
31
31
}
32
32
33
- public function current ()
33
+ public function current (): Window
34
34
{
35
- return (object ) $ this ->client ->get ('window/current ' )->json ();
35
+ $ window = (object ) $ this ->client ->get ('window/current ' )->json ();
36
+
37
+ return (new Window ($ window ->id ))
38
+ ->setClient ($ this ->client )
39
+ ->fromRuntimeWindow ($ window );
40
+ }
41
+
42
+ public function get (string $ id ): Window
43
+ {
44
+ $ window = (object ) $ this ->client ->get ("window/get/ {$ id }" )->json ();
45
+
46
+ return (new Window ($ window ->id ))
47
+ ->setClient ($ this ->client )
48
+ ->fromRuntimeWindow ($ window );
36
49
}
37
50
38
51
public function resize ($ width , $ height , $ id = null )
You can’t perform that action at this time.
0 commit comments