wayland cursor embeded

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-11-29 16:36:35 +08:00
parent e13e0ab18f
commit 4d044ca57a
18 changed files with 152 additions and 82 deletions

View File

@@ -221,6 +221,7 @@ class FfiModel with ChangeNotifier {
_display.y = double.parse(evt['y']);
_display.width = int.parse(evt['width']);
_display.height = int.parse(evt['height']);
_display.cursorEmbeded = int.parse(evt['cursor_embeded']) == 1;
if (old != _pi.currentDisplay) {
parent.target?.cursorModel.updateDisplayOrigin(_display.x, _display.y);
}
@@ -330,6 +331,7 @@ class FfiModel with ChangeNotifier {
d.y = d0['y'].toDouble();
d.width = d0['width'];
d.height = d0['height'];
d.cursorEmbeded = d0['cursor_embeded'] == 1;
_pi.displays.add(d);
}
if (_pi.currentDisplay < _pi.displays.length) {
@@ -582,6 +584,9 @@ class CanvasModel with ChangeNotifier {
notifyListeners();
}
bool get cursorEmbeded =>
parent.target?.ffiModel.display.cursorEmbeded ?? false;
int getDisplayWidth() {
final defaultWidth = (isDesktop || isWebDesktop)
? kDesktopDefaultDisplayWidth
@@ -1311,6 +1316,7 @@ class Display {
double y = 0;
int width = 0;
int height = 0;
bool cursorEmbeded = false;
Display() {
width = (isDesktop || isWebDesktop)