Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with DetectKnownPixelColorsToPreventAccidentalEvents #35

Closed
boromyr opened this issue Dec 1, 2021 · 13 comments
Closed

Problem with DetectKnownPixelColorsToPreventAccidentalEvents #35

boromyr opened this issue Dec 1, 2021 · 13 comments

Comments

@boromyr
Copy link

boromyr commented Dec 1, 2021

Hi,
Thanks for this great app that I've been using for a while now.

With the latest version V2.0.0 the app stops working if I enable DetectKnownPixelColorsToPreventAccidentalEvents.
I tried starting the app from a new location and with the default settings, after closing all programs with KillEmAll to make sure to eliminate any conflicts with other apps. Only the NOD32 antivirus remains open, which I don't think can interfere.

Mini FR: is it possible to eliminate the popup warning of configuration file modification and set the automatic reload?

Thank you.

@HerMajestyDrMona
Copy link
Owner

HerMajestyDrMona commented Dec 1, 2021

Hi, I'm happy that you like the fix!

Mini FR: is it possible to eliminate the popup warning of configuration file modification and set the automatic reload?

Yes, please take a look at:
https://github.com/HerMajestyDrMona/Windows11DragAndDropToTaskbarFix/blob/main/CONFIGURATION.md#should-the-program-monitor-file-windows11draganddroptotaskbarfixconfigtxt-for-changes

EDIT: Opps, I read wrongly. I'll think about it, but hitting "ENTER" in the popup also isn't that problematic.

By the "app stops working" do you mean the program crashes / terminates, or simply the drag and drop doesn't work as should?

Could you please try the following steps and tell me if it changes anything?

  1. Type in Start: "View advanced system settings" and open it.
  2. Go to the "Advanced" tab.
  3. Click on the "Settings" button next to the "Performance" field.
  4. Check option: "Adjust for best appearance" and Apply / OK.

Maybe there was some option which decides about displaying the "error icon" unchecked. We will see :)

@HerMajestyDrMona
Copy link
Owner

@boromyr Any update on this issue?

@boromyr
Copy link
Author

boromyr commented Dec 3, 2021

Sorry, I didn't have time to reply.
I tried it and the problem persists, but I want to try again by booting Windows in safe mode as soon as I have time, to make sure no apps can interfere.

In the meantime, if someone has the same problem can report it here to understand if it's really a bug or a problem of mine

@HerMajestyDrMona
Copy link
Owner

No worries, thanks for replying back.

Can you tell me, when you're dragging a file, and it's on the taskbar icon, can you see a small icon under the mouse, which looks like a white paper and a stop sign on it? It is supposed to look like this: https://i.redd.it/q1b7dpv1gjb71.jpg

Also, as in my previous question: do you mean that the program crashes (closes itself) or just dragging doesn't work?

@boromyr
Copy link
Author

boromyr commented Dec 4, 2021

The process continues to run normally, but drag and drop doesn't work, the behavior is as follows:

Animation
For completeness I enclose the config file I use. Obviously DetectKnownPixelColorsToPreventAccidentalEvents is enabled during testing.
Windows11DragAndDropToTaskbarFixConfig.txt

@HerMajestyDrMona
Copy link
Owner

HerMajestyDrMona commented Dec 4, 2021

Yes, I see what the problem is. Your icon looks differently than the default one in Windows 11. As you can see, you get the "stop" symbol on the right from the mouse cursor. It doesn't look like the one on Windows 11: https://i.redd.it/q1b7dpv1gjb71.jpg

So DetectKnownPixelColorsToPreventAccidentalEvents is trying to find the colors of pixels above the cursor to match the while/red symbol at certain positions, but in your case it will never return true because it's somewhere else.

Can you please tell me what modifications did you use to change this icon?

@boromyr
Copy link
Author

boromyr commented Dec 5, 2021

I use a custom .msstyle "Matte" theme downloaded from DeviantArt, but I had already tried with the default Windows 11 theme before opening this thread. The stop symbol still shows up when I drag the icon to the empty taskbar, though a little different graphically.

@HerMajestyDrMona
Copy link
Owner

HerMajestyDrMona commented Dec 5, 2021

I know that the stop symbol shows up for you, but it's in a different position than Windows 11 default.

DetectKnownPixelColorsToPreventAccidentalEvents is searching for colors of few pixels above the mouse cursor:

int PointYScaled = static_cast<int>((P.y * Current_DPI_Scale_Y));
int PointXScaled = static_cast<int>((P.x * Current_DPI_Scale_X));
for (int iii = 14; iii < 31; iii++) {
int PointYWithOffsetNow = PointYScaled - iii;
COLORREF color_now = GetPixel(dc, PointXScaled, PointYWithOffsetNow);
if (color_now == our_red) {
if (PrevColor1 == our_white && PrevColor2 == our_white && PrevColor3 == our_white) {
ToReturn = true;
break;
}
}
PrevColor1 = PrevColor2;
PrevColor2 = PrevColor3;
PrevColor3 = color_now;
}

It searches for pixels above 14-31 (it depends on different DPI scaling settings) to find: white, white, white, red color. Then there is 99.9% of chance that the error stop icon is shown on Windows default theme.

When you're using a different system theme that changed the look / position of this error icon, then Windows11DragAndDropToTaskbarFix is unable to find it.

So in your case it's best to set DetectKnownPixelColorsToPreventAccidentalEvents=0 since I can not add support for all custom themes available on the Internet.

I was thinking about auto-disabling DetectKnownPixelColorsToPreventAccidentalEvents when the correct pixels are never detected (so it would start working only after it found the correct pixels for the first time), but that could cause different problems, for example people working in Word / Excel would get apps unintentionally opened, just because they didn't attempt to drag anything after computer restart. So I decided that it's better to keep it as it is now, until I come up with a better detection solution.

@boromyr
Copy link
Author

boromyr commented Dec 5, 2021

since I can not add support for all custom themes available on the Internet.

Absolutely correct, understood the problem, so we could add to the command description: "not compatible with custom skin modifications", or something like that. So if other users experience the same issue, they can disable DetectKnownPixelColorsToPreventAccidentalEvents=0 and continue using this app.

Thank you very much for your help!!!!

@HerMajestyDrMona
Copy link
Owner

HerMajestyDrMona commented Dec 5, 2021

Good idea for the description thing. I hoped that it could be somehow programmatically detected, though.

Maybe I could use a cookie file instead, in the Temp folder. So my idea is the following:

When DetectKnownPixelColorsToPreventAccidentalEvents is enabled:

  • Detect for Pixels normally.
  • If detected, and the cookie file doesn't exist in the Temp folder, then create it.
  • If pixels not detected, and the cookie file existed (checked on program startup), then do not continue.
  • If pixels not detected, and the cookie file didn't exist, then continue, because it could mean that the custom theme is installed.

So in short: if these pixels were ever detected correctly, then use this feature, otherwise keep it "disabled" until it's detected for the first time.

Does that make any sense? Or better to simply force people to configure it manually? Hmm...
Installing a custom theme after using Windows11DrangAndDropToTaskbarFix could also cause the same issues.

@HerMajestyDrMona
Copy link
Owner

Hi @boromyr

Mini FR: is it possible to eliminate the popup warning of configuration file modification and set the automatic reload?

This feature has been added in ver. 2.1.0.0.

You can enable it by setting:

ConfigFileChangeTimeMonitorAllowed=2

I added the information about the custom skins / themes to the main page. For now it should be enough.

Greetings.

@boromyr
Copy link
Author

boromyr commented Dec 13, 2021

Thanks!!!! Sorry I've been a little busy, as soon as I can, I'll explore the new features!

@HerMajestyDrMona
Copy link
Owner

I'll close this issue for now :) Hopefully nobody else experiences such problems. I'll be still thinking about the solution for it (to automatically detect custom themes), but to be honest I'm not sure if it's worth to focus so much on this program, if in 10 months it won't longer be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants