Git Product home page Git Product logo

Comments (9)

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 18, 2024 1

Closing.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 18, 2024

Questions.

  • Does flutter-elinux with X11 work without the issue?
  • Do other wayland apps work?

If both are "Yes", this issue depends on only wayland backend of this software.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 18, 2024

Also, are you using --fullscreen option?

from flutter-embedded-linux.

makotosato-at avatar makotosato-at commented on July 18, 2024

Thank you for reply.

Does flutter-elinux with X11 work without the issue?

Yes.

Do other wayland apps work?

Yes. (For example, weston-terminal works fine.)

Also, are you using --fullscreen option?

Yes. I use --fullscreen (-f) option.

I tried the following patch and it works.

diff --git a/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.cc b/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.cc
index fa147f6..0652954 100644
--- a/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.cc
+++ b/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.cc
@@ -628,6 +628,8 @@ const wl_output_listener ELinuxWindowWayland::kWlOutputListener = {
                    const char* model,
                    int32_t output_transform) -> void {
       ELINUX_LOG(TRACE) << "wl_output_listener.geometry";
+      auto self = reinterpret_cast<ELinuxWindowWayland*>(data);
+      self->transform_ = output_transform;
     },
     .mode = [](void* data,
                wl_output* wl_output,
@@ -639,7 +641,11 @@ const wl_output_listener ELinuxWindowWayland::kWlOutputListener = {
 
       auto self = reinterpret_cast<ELinuxWindowWayland*>(data);
       if (flags & WL_OUTPUT_MODE_CURRENT) {
-        if (self->current_rotation_ == 90 || self->current_rotation_ == 270) {
+        if (self->current_rotation_ == 90 || self->current_rotation_ == 270
+            || self->transform_ == WL_OUTPUT_TRANSFORM_90
+            || self->transform_ == WL_OUTPUT_TRANSFORM_270
+            || self->transform_ == WL_OUTPUT_TRANSFORM_FLIPPED_90
+            || self->transform_ == WL_OUTPUT_TRANSFORM_FLIPPED_270) {
           std::swap(width, height);
         }
 
diff --git a/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.h b/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.h
index 2d1343d..dcfe1bb 100644
--- a/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.h
+++ b/src/flutter/shell/platform/linux_embedded/window/elinux_window_wayland.h
@@ -153,6 +153,7 @@ class ELinuxWindowWayland : public ELinuxWindow, public WindowBindingHandler {
   bool maximised_;
   uint32_t last_frame_time_;
   bool enable_impeller_ = false;
+  int32_t transform_ = WL_OUTPUT_TRANSFORM_NORMAL;
 
   // Indicates that exists a keyboard show request from Flutter Engine.
   bool is_requested_show_virtual_keyboard_;

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 18, 2024

Makes sense. Could you please send a PR?

int32_t transform_ = WL_OUTPUT_TRANSFORM_NORMAL;

Can we use current_rotation_ var instead of the creation of transform_?

from flutter-embedded-linux.

makotosato-at avatar makotosato-at commented on July 18, 2024

Can we use current_rotation_ var instead of the creation of transform_?

Unfortunately no.

current_rotation_ is used in GetRotationDegree()

uint16_t ELinuxWindowWayland::GetRotationDegree() const {
  return current_rotation_;
}

but, the value of output_transform is 0 to 7.

enum wl_output_transform {
	WL_OUTPUT_TRANSFORM_NORMAL = 0,
	WL_OUTPUT_TRANSFORM_90 = 1,
	WL_OUTPUT_TRANSFORM_180 = 2,
	WL_OUTPUT_TRANSFORM_270 = 3,
	WL_OUTPUT_TRANSFORM_FLIPPED = 4,
	WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,
	WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,
	WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,
};

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 18, 2024

but, the value of output_transform is 0 to 7.

Isn't it sufficient to just convert the value when assigning it to current_rotation_? Also, it feels incorrect because it would result in a discrepancy with the information on the Flutter Engine side.

from flutter-embedded-linux.

HidenoriMatsubayashi avatar HidenoriMatsubayashi commented on July 18, 2024

Apologies, it was a misunderstanding on my part. Your original patch is correct because this involves rotation on the Wayland compositor side, so there's no need to convey this information to the Flutter Engine side.

Can you please send the pull request?

from flutter-embedded-linux.

makotosato-at avatar makotosato-at commented on July 18, 2024

Thank you.
I sent a PR.

from flutter-embedded-linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.