win32ss / supermium

Chromium fork for Windows XP/2003 and up
https://win32subsystem.live/supermium/
BSD 3-Clause "New" or "Revised" License
2.22k stars 74 forks source link

[Visual, Enhancement] Missing button state for Restore button #604

Open XakerTwo opened 4 months ago

XakerTwo commented 4 months ago

Description When you have aero enabled, applied browser theme, browser window is maximized and restore button pressed it "did not pressing" and visually stay in hovered state. Seems that is an aero only issue, so reporting this to chromium/chrome is useless. It's minor UI bug so not urgent

To Reproduce

  1. Apply any theme that has custom frame (say with id kbkgdmbcegbedgcjpekbineokpgpkikd)
  2. Maximize browser window if not yet
  3. Hover over Restore button
  4. Press and hold it - visually button still not pressed
  5. Check Close or Minimize button - it will pressing

Expected behavior It should behave like any other button here

Screenshots

Button in normal, hovered and pressed states, captured on VM with Supermium 122.0.6261.85 R2
No theme (system implementation) ![restore_system_states](https://github.com/win32ss/supermium/assets/13261533/af9dc77f-f211-4943-94fe-394554d4ac29)
With theme (browser implementation) ![restore_browser_states](https://github.com/win32ss/supermium/assets/13261533/45f42fec-c0ac-4c04-95d9-5cf6188d9632)
Minimize button with theme (for comparison) ![minimize_browser_states](https://github.com/win32ss/supermium/assets/13261533/49c10066-0bca-44ad-ad98-9cc465c6cdb3)
Chrome 109 Metro and Aero chrome_100_percent.pak resources (exactly same in 200% and for Supermium) ![chrome_100_metro](https://github.com/win32ss/supermium/assets/13261533/a14bd7c1-4af0-46e5-b4bd-5b9cbfa32658) ![chrome_100_aero](https://github.com/win32ss/supermium/assets/13261533/bdadddfb-5f82-420f-ad2f-51c67fb879fe)

Desktop:

Additional context By default browser use the system implementation of window frame and Minimize, Maximize/Restore and Close buttons. But when apply theme, that defines frame color, browser switches to own implementation and there some resources for those buttons in chrome_100_percent.pak and chrome_200_percent.pak.

So when you press restore button there no visual change/feedback. I checked resources of Chrome 109 and same there - no resource for pressed state of Restore button and next id is free

XakerTwo commented 4 months ago

small update - seems issue happens due to the same hash for restore_hover.png and restore_pressed.png images, and on packing, one of the resource aliasing to other so only one image packed.

also seems that resource for the restore icon hover state is different even from minimize and maximize. But image format is a bit unusual - 8bit grayscale+alpha (16bit). Due to lack of tool that be able to save in same format, i can provide only 8bpp RGB+alpha (32bit). It's also supported and used by close button.

restore_hover.png restore_hover restore_pressed.png restore_pressed

and it's looks like that (almost no difference on image but noticeable in action) ![restore_browser_states_fixed](https://github.com/win32ss/supermium/assets/13261533/622cbbb9-b02a-4d30-8f52-e96507ba7e72)

btw once i managed to unalias them to separate resources, fixing become even more unurgent, but now it's as simple for you as copy-paste without any further changes (aliasing is packager thing, once files becomes different, it should not aliase them).

XakerTwo commented 2 months ago

just reminder

Still actual Supermium: 124.0.6367.245 RC1