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

Add setThumbnailClip API on Windows #6497

Merged
merged 3 commits into from Jul 15, 2016

Conversation

Projects
None yet
5 participants
@kevinsawicki
Contributor

kevinsawicki commented Jul 14, 2016

This pull requests adds a setThumbnailClip(region) API to BrowserWindow instances on Windows that can be used to control which region of the window is used to generate the thumbnail image displayed in the taskbar when the window is hoverered over.

For the sample Electron app if you called it as:

require('electron').remote.getCurrentWindow().setThumbnailClip({x:0, y:0, width:500, height:100})

It would change the taskbar thumbnail from:

Default Set via setThumbnailClip
screen shot 2016-07-14 at 3 52 22 pm screen shot 2016-07-14 at 3 51 55 pm

This can be useful for media-related apps that want the thumbnail to be the specific content such as an image, video element, etc.

Closes #2623

kevinsawicki added some commits Jul 14, 2016

@zcbenz

This comment has been minimized.

Contributor

zcbenz commented Jul 15, 2016

👍

@zcbenz zcbenz merged commit d186a01 into master Jul 15, 2016

8 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
electron-linux-arm Build #3665892 succeeded in 41s
Details
electron-linux-ia32 Build #3665893 succeeded in 38s
Details
electron-linux-x64 Build #3665894 succeeded in 73s
Details
electron-mas-x64 Build #1940 succeeded in 5 min 51 sec
Details
electron-osx-x64 Build #1942 succeeded in 7 min 12 sec
Details
electron-win-ia32 Build #944 succeeded in 6 min 12 sec
Details
electron-win-x64 Build #932 succeeded in 6 min 25 sec
Details

@zcbenz zcbenz deleted the windows-thumbnail branch Jul 15, 2016

@YurySolovyov

This comment has been minimized.

Contributor

YurySolovyov commented Jul 15, 2016

Is there a way to reset it afterwards?

@YurySolovyov

This comment has been minimized.

Contributor

YurySolovyov commented Jul 15, 2016

@kevinsawicki I'm not sure this really closes the issue, what if I want to provide my own image that is not related to currently displayed window without clipping ?
Seems like https://msdn.microsoft.com/en-us/library/windows/desktop/dd562049(v=vs.85).aspx provides more powerful way to provide your own image.

@MarshallOfSound

This comment has been minimized.

Member

MarshallOfSound commented Jul 15, 2016

@kevinsawicki @YurySolovyov

To be honest when I saw that original issue this was the API I was imagining 😄

https://msdn.microsoft.com/en-us/library/dd389410(v=vs.85).aspx

Let's you set a custom BitMap to be the live preview. Not quite sure how this would fit into an electron API though 👍

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Jul 15, 2016

Is there a way to reset it afterwards?

You can reset it by passing in an empty area {x:0, y:0, width: 0, height: 0}

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Jul 15, 2016

@YurySolovyov @MarshallOfSound Yeah, setting a thumbnail image would be useful to have in addition to this API.

I created a new issue specifically for it at #6508 👍

@paulcbetts

This comment has been minimized.

Contributor

paulcbetts commented Aug 7, 2016

Have you tried this API on a non-100% DPI display? I suspect you need to do some multiplication to convert 96DPI pixel units to HWND pixels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment