Convert dip to screen rect for thumbnail clip
This commit is contained in:
parent
6cd99ebf6b
commit
5f2a13d01b
1 changed files with 7 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
|||
#include "base/win/scoped_gdi_object.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "ui/display/win/screen_win.h"
|
||||
#include "ui/gfx/icon_util.h"
|
||||
|
||||
namespace atom {
|
||||
|
@ -167,11 +168,13 @@ bool TaskbarHost::SetThumbnailClip(HWND window, const gfx::Rect& region) {
|
|||
if (region.IsEmpty()) {
|
||||
return SUCCEEDED(taskbar_->SetThumbnailClip(window, NULL));
|
||||
} else {
|
||||
gfx::Rect screen_rect = display::win::ScreenWin::DIPToScreenRect(window,
|
||||
region);
|
||||
RECT rect;
|
||||
rect.left = region.x();
|
||||
rect.right = region.right();
|
||||
rect.top = region.y();
|
||||
rect.bottom = region.bottom();
|
||||
rect.left = screen_rect.x();
|
||||
rect.right = screen_rect.right();
|
||||
rect.top = screen_rect.y();
|
||||
rect.bottom = screen_rect.bottom();
|
||||
return SUCCEEDED(taskbar_->SetThumbnailClip(window, &rect));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue