airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
201 stars 11 forks source link

[Linux] Application window launches as "always on top" with some OSes #3328

Open itlancer opened 3 months ago

itlancer commented 3 months ago

Problem Description

Application window launches as "always on top" with some Linux OSes. It breaks UX and cause instability in window manipulations. Only minimizations or some similar manipulations with window makes behavior normal.

Tested with multiple AIR versions, even with latest AIR 51.0.1.3 with multiple different Linux x86_64 devices with different applications. With VM and real devices. With Ubuntu 22.04 x86_64 it always reproducible.

Related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/3317 https://github.com/airsdk/Adobe-Runtime-Support/issues/3239 https://github.com/airsdk/Adobe-Runtime-Support/issues/3203 https://github.com/airsdk/Adobe-Runtime-Support/issues/2549 https://github.com/airsdk/Adobe-Runtime-Support/issues/2548 https://github.com/airsdk/Adobe-Runtime-Support/issues/2534 https://github.com/airsdk/Adobe-Runtime-Support/issues/2241 https://github.com/airsdk/Adobe-Runtime-Support/issues/1840

Steps to Reproduce

1) Launch any application with GUI window using Ubuntu 22.04 x86_64. Calculator, Terminal... Better if it will be maximized on whole screen. 2) Launch application with code below with Ubuntu 22.04 x86_64. AIR application window should overlay some application window launched before. 3) Click to application window below (under AIR application window) to switch focus to other window.

Application example with sources attached. linux_always_on_top_bug.zip

package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.utils.setTimeout;

    public class LinuxAlwaysOnTopBug extends Sprite {

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

        private function addedToStage(e:Event):void {
            removeEventListener(Event.ADDED_TO_STAGE, addedToStage);

            //Uncomment lines below for workaround:
            //stage.nativeWindow.alwaysInFront = true;
            //setTimeout(function():void {
            //  stage.nativeWindow.alwaysInFront = false;
            //}, 100);
        }

    }
}

Actual Result: AIR application window still in front of other windows. Only after manual minimization and restoring it start to work normally.

Expected Result: AIR application window goes below other window. No fake "always in front" behavior.

Known Workarounds

Change NativeWindow::alwaysInFront twice with short timeout as shown in code above.

itlancer commented 3 months ago

Issue still exists with latest AIR 51.0.1.4.

itlancer commented 2 months ago

Issue still exists with latest AIR 51.1.1.2.