AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.92k stars 2.24k forks source link

Rendering breaks on minimize and unminimize #7278

Open mr6r4y opened 2 years ago

mr6r4y commented 2 years ago

A straight out of avalonia.mvvm template basic application is not rendered after minimize and unminimize.

To Reproduce Steps to reproduce the behavior:

  1. Create an app from template: dotnet new avalonia.mvvm -o testapp -n testapp
  2. Build and run the application
  3. Minimize and unminimize the window

Expected behavior See the normal application window after unminimize.

Screenshots avalonia_test_app avalonia_render_bug

Desktop (please complete the following information):

kekekeks commented 2 years ago

1) xwininfo, click on your window to get window id 2) xev -id <your_window_id> 3) minimize your window, press enter multiple times in console to have a split 4) unminimize 5) send xev output

luthfiampas commented 2 years ago

@kekekeks Just tried to reproduce this issue on my Mint machine. Here's the output.

Minimize

PropertyNotify event, serial 18, synthetic NO, window 0x4400179,
    atom 0x1bd (_NET_WM_ALLOWED_ACTIONS), time 847079, state PropertyNewValue

UnmapNotify event, serial 19, synthetic NO, window 0x4400179,
    event 0x4400179, window 0x4400179, from_configure NO

PropertyNotify event, serial 19, synthetic NO, window 0x4400179,
    atom 0x151 (WM_STATE), time 847081, state PropertyNewValue

PropertyNotify event, serial 19, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 847081, state PropertyNewValue

Unminimize

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x1bd (_NET_WM_ALLOWED_ACTIONS), time 854669, state PropertyNewValue

MapNotify event, serial 21, synthetic NO, window 0x4400179,
    event 0x4400179, window 0x4400179, override NO

VisibilityNotify event, serial 21, synthetic NO, window 0x4400179,
    state VisibilityUnobscured

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x151 (WM_STATE), time 854674, state PropertyNewValue

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 854674, state PropertyNewValue

FocusIn event, serial 21, synthetic NO, window 0x4400179,
    mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 21, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 854675, state PropertyNewValue

FocusOut event, serial 21, synthetic NO, window 0x4400179,
    mode NotifyNormal, detail NotifyNonlinear

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 859801, state PropertyNewValue
kekekeks commented 2 years ago

Just tried to reproduce this issue on my Mint machine.

Did you manage to reproduce on said Mint machine? Mint has a different window manager.

luthfiampas commented 2 years ago

Just tried to reproduce this issue on my Mint machine.

Did you manage to reproduce on said Mint machine? Mint has a different window manager.

Yes, I can reproduce in both MATE and Cinnamon edition.

image

luthfiampas commented 2 years ago

Not sure if this can be helpful, if I set UseGpu to false, after unminimize, the window content becomes transparent. Resizing the window will fix the glitch.

https://user-images.githubusercontent.com/57059775/147652309-78a09958-e91d-4966-89cf-b84b54a91691.mp4

tuanacetinkaya commented 1 year ago

same serial code fails for me too, normally it's assigned to synthetic yes event. (in the output you can see the opposite behavior acted as synthetic no event)

Previously I deleted the xmodmap hotkey for serial 34 (i guess?) by hand and it was randomly assigned to synthetic yes as I saw in the terminal output before.

it was assigned to multiple random keystrokes like up-down etc.

@kekekeks Just tried to reproduce this issue on my Mint machine. Here's the output.

Minimize

PropertyNotify event, serial 18, synthetic NO, window 0x4400179,
    atom 0x1bd (_NET_WM_ALLOWED_ACTIONS), time 847079, state PropertyNewValue

UnmapNotify event, serial 19, synthetic NO, window 0x4400179,
    event 0x4400179, window 0x4400179, from_configure NO

PropertyNotify event, serial 19, synthetic NO, window 0x4400179,
    atom 0x151 (WM_STATE), time 847081, state PropertyNewValue

PropertyNotify event, serial 19, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 847081, state PropertyNewValue

Unminimize

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x1bd (_NET_WM_ALLOWED_ACTIONS), time 854669, state PropertyNewValue

MapNotify event, serial 21, synthetic NO, window 0x4400179,
    event 0x4400179, window 0x4400179, override NO

VisibilityNotify event, serial 21, synthetic NO, window 0x4400179,
    state VisibilityUnobscured

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x151 (WM_STATE), time 854674, state PropertyNewValue

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 854674, state PropertyNewValue

FocusIn event, serial 21, synthetic NO, window 0x4400179,
    mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 21, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 854675, state PropertyNewValue

FocusOut event, serial 21, synthetic NO, window 0x4400179,
    mode NotifyNormal, detail NotifyNonlinear

PropertyNotify event, serial 21, synthetic NO, window 0x4400179,
    atom 0x130 (_NET_WM_STATE), time 859801, state PropertyNewValue

Originally posted by @luthfiampas in https://github.com/AvaloniaUI/Avalonia/issues/7278#issuecomment-1002420858

Now, technically when everything is going well, this triggers an output like below: image

Again, technically, I know the spot I deleted in edit file and if I try I can paste the assigned yes value and the problem would no longer occur. Not sure, I'll post an update if it works.

EDIT: image

in the terminal you need to look for ClientMessage event, it targets the missing event name (in this case synthetic YES) and the reason (I guess?) : format 32 (which is probably the number I've deleted)

EDIT -2:

image

looking from one of my extensions, the event for alt + shift + d is now unassigned. those worked like toggle on and off buttons.

I'll try to configure the keyboard settings again from my keyboard defaults in order to restore the exact path inside the xmodmap configuration file. (I'll update if works)