refactor: rename KWinWindow to DriverWindow

This commit is contained in:
Mikhail Zolotukhin 2021-10-19 00:16:51 +03:00
parent d44eb13fb7
commit 3241774800
2 changed files with 13 additions and 7 deletions

View File

@ -5,7 +5,7 @@
import { DriverSurface } from "./surface"; import { DriverSurface } from "./surface";
import { DriverSurfaceImpl } from "./surface"; import { DriverSurfaceImpl } from "./surface";
import { KWinWindow } from "./window"; import { DriverWindowImpl } from "./window";
import { Controller } from "../controller"; import { Controller } from "../controller";
import { Action } from "../controller/action"; import { Action } from "../controller/action";
@ -71,7 +71,7 @@ export class KWinDriver implements DriverContext {
public set currentWindow(window: EngineWindow | null) { public set currentWindow(window: EngineWindow | null) {
if (window !== null) { if (window !== null) {
this.kwinApi.workspace.activeClient = ( this.kwinApi.workspace.activeClient = (
window.window as KWinWindow window.window as DriverWindowImpl
).client; ).client;
} }
} }
@ -124,10 +124,16 @@ export class KWinDriver implements DriverContext {
this.controller = controller; this.controller = controller;
this.windowMap = new WrapperMap( this.windowMap = new WrapperMap(
(client: KWin.Client) => KWinWindow.generateID(client), (client: KWin.Client) => DriverWindowImpl.generateID(client),
(client: KWin.Client) => (client: KWin.Client) =>
new EngineWindowImpl( new EngineWindowImpl(
new KWinWindow(client, this.qml, this.kwinApi, this.config, this.log), new DriverWindowImpl(
client,
this.qml,
this.kwinApi,
this.config,
this.log
),
this.config, this.config,
this.log this.log
) )
@ -200,7 +206,7 @@ export class KWinDriver implements DriverContext {
const maximized = h === true && v === true; const maximized = h === true && v === true;
const window = this.windowMap.get(client); const window = this.windowMap.get(client);
if (window) { if (window) {
(window.window as KWinWindow).maximized = maximized; (window.window as DriverWindowImpl).maximized = maximized;
this.controller.onWindowMaximizeChanged(window, maximized); this.controller.onWindowMaximizeChanged(window, maximized);
} }
}; };

View File

@ -29,7 +29,7 @@ export interface DriverWindow {
visible(srf: DriverSurface): boolean; visible(srf: DriverSurface): boolean;
} }
export class KWinWindow implements DriverWindow { export class DriverWindowImpl implements DriverWindow {
public static generateID(client: KWin.Client): string { public static generateID(client: KWin.Client): string {
return `${String(client)}/${client.windowId}`; return `${String(client)}/${client.windowId}`;
} }
@ -150,7 +150,7 @@ export class KWinWindow implements DriverWindow {
private log: Log private log: Log
) { ) {
this.client = client; this.client = client;
this.id = KWinWindow.generateID(client); this.id = DriverWindowImpl.generateID(client);
this.maximized = false; this.maximized = false;
this.noBorderManaged = false; this.noBorderManaged = false;
this.noBorderOriginal = client.noBorder; this.noBorderOriginal = client.noBorder;