Skip to content

[Linux] NativeWindow::maximize() do nothing after NativeApplication.nativeApplication.activate() with X11 Window Manager #4308

Description

@itlancer

Problem Description

NativeWindow::maximize() do nothing after NativeApplication.nativeApplication.activate() with X11 Window Manager for Linux.

Tested with multiple AIR versions, even with latest AIR 51.3.4.1 with multiple different Linux Ubuntu 24.04 x86_64 devices with different applications.
Same problem in all cases with Ubuntu 24.04 LTS physical devices using X11.
There is no such issue with Ubuntu 24.04 LTS VM using Wayland.
Also there is no such issue with Windows.

Related issues:
#4307
#3976
#3689
#3505
#3241
#3239
#3177
#3176
#2497
#2495
#2208
#1200
#4119

Steps to Reproduce

Launch application with code below with any Ubuntu 24.04 LTS device using X11.
It activate NativeWindow and then maximize it.
Application example with sources attached.

linux_nativeapplication_activate_nativewindowdisplaystate_maximized_event_bug.zip

package {
	import flash.display.Sprite;
	import flash.display.NativeWindow;
	import flash.events.Event;
	import flash.events.NativeWindowDisplayStateEvent;
	import flash.desktop.NativeApplication;

	public class LinuxNativeApplicationActivateNativeWindowDisplayStateMaximizedEventBug extends Sprite {
		private var window:NativeWindow;

		public function LinuxNativeApplicationActivateNativeWindowDisplayStateMaximizedEventBug() {
			addEventListener(Event.ADDED_TO_STAGE, addedToStage);
		}

		private function addedToStage(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
			window = stage.nativeWindow;

			trace("activate");
			NativeApplication.nativeApplication.activate(window);

			trace("maximize", window.displayState);//returns normal
			window.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGE, displayStateChange);
			window.maximize();//This line do nothing with X11 Window Manager
		}

		private function displayStateChange(e:NativeWindowDisplayStateEvent):void {
			//This event will not be dispatched
			trace("displayStateChange", e.beforeDisplayState, "->", e.afterDisplayState);
		}
	}
}

Actual Result:
Window not maximized.
NativeWindowDisplayState.MAXIMIZED event not dispatched.
In traces you will see:

activate
maximize normal

Expected Result:
Window maximized.
NativeWindowDisplayState.MAXIMIZED event dispatched.
In traces you will see:

activate
maximize normal
displayStateChange normal -> maximized

Known Workarounds

none

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions