Comments (2)
This has been an absolutely hideous issue to debug, and after four hours of fighting it I'm simply implementing a cheap workaround.
The problem occurs because "Classic Theme" changes the behavior of a bunch of API calls related to menu icon placement, in essence "mimicking" an unthemed environment from the Win 2K era. PhotoDemon accounts for this and automatically falls back to a subclassing-based menu icon system, which is required on XP anyway, and which works quite well in an unthemed environment.
The subclassing system relies upon intercepting WM_DRAWITEM messages and responding accordingly. This works without incident on XP. Under the "Classic Theme" it also works fine, except in the case of disabled and non-hovered menus. For reasons I do not understand (and cannot find documentation on), the hDC included in the window message for disabled and non-hovered menus is completely invalid. Because it is invalid, any paint operations applied to it silently fail. If disabled AND hovered, the returned hDC is valid and drawing is fine - as you can see with the "ghosted upon hover" behavior.
Because I've already wasted half a day on this and can't find any rational explanation for the behavior, I'm just disabling drawing of disabled icons if the "classic" theme is in use.
from photodemon.
Well... there is another workaround, but I'm not sure I like it better. Instead of falling back to the subclassing method, we can still use the theming-based API calls to set menu icons. The spacing is very cramped, but upon further investigation, this appears to be the behavior that other applications adopt when run under the "Classic Theme."
Given the choice between a workaround that doesn't draw disabled icons at all, or one that draws all icons but with minimal margins BUT is the same behavior as other applications, I'm probably inclined to go with the second workaround.
Commit incoming.
from photodemon.
Related Issues (20)
- PD don't show the untranslated phrases ? HOT 3
- [BUG] - XBM images make PhotoDemon freeze HOT 5
- fill with an image as pattern HOT 1
- Simplified Chinese Language xml--2024-3-15 for v9.2 build 311 HOT 1
- Add more drag+drop targets on the primary window
- [Feature Request] - (Animated Screen Capture)
- Application Errors opening PNG files - PhotoDemon 9.2 pre-alpha (build 339 (and a few before) HOT 2
- [Feature request] - Migrate current project to Xojo (cross platform language)? HOT 17
- PhotoDemon and twinBASIC HOT 9
- Simplified Chinese Language xml , 2024-4-25 for build 380 HOT 1
- [BUG] - Low bit dithered images when exported are larger than their higher bit depth counterparts HOT 2
- Simplified_Chinese 2024.4 build 41 HOT 2
- The anti aliasing quality of the pen and brush is low HOT 2
- Simplified_Chinese-2024.4 buile42 HOT 1
- [Feature request] - disable save options window, use defaults HOT 2
- Thumbnailer attachments HOT 5
- [BUG] - (Unknown Processor Request Submitted: Palette) HOT 3
- [i18n problem] - I have created Japanese language file HOT 6
- [BUG] - Crashes on certain operations during PDF import HOT 7
- Two questions related to JPEG-XL functionality HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photodemon.