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
4040
4141 protected bool $ focusable = true ;
4242
43+ protected bool $ focused = false ;
44+
4345 protected bool $ hasShadow = true ;
4446
4547 protected bool $ frame = true ;
@@ -282,4 +284,13 @@ public function afterOpen(callable $cb): static
282284
283285 return $ this ;
284286 }
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+ }
285296}
Original file line number Diff line number Diff line change @@ -30,9 +30,22 @@ public function hide($id = null)
3030 ]);
3131 }
3232
33- public function current ()
33+ public function current (): Window
3434 {
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 );
3649 }
3750
3851 public function resize ($ width , $ height , $ id = null )
You can’t perform that action at this time.
0 commit comments