mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Fix tooltips in multi-displays mode when the Preview window is open
This commit is contained in:
parent
ff3b14978a
commit
4f4f5fee7f
@ -760,19 +760,16 @@ void Manager::updateMouseWidgets(const gfx::Point& mousePos,
|
||||
Widget* widget = nullptr;
|
||||
for (auto mouseWidget : mouse_widgets_list) {
|
||||
if (get_multiple_displays()) {
|
||||
gfx::Point displayPos;
|
||||
if (display) {
|
||||
if (display != mouseWidget->display()) {
|
||||
displayPos = mouseWidget->display()->nativeWindow()->pointFromScreen(screenPos);
|
||||
widget = mouseWidget->display()->containedWidget()->pick(displayPos);
|
||||
widget = mouseWidget->display()->containedWidget()->pickFromScreenPos(screenPos);
|
||||
}
|
||||
else {
|
||||
widget = mouseWidget->pick(mousePos);
|
||||
}
|
||||
}
|
||||
else {
|
||||
displayPos = mouseWidget->display()->nativeWindow()->pointFromScreen(screenPos);
|
||||
widget = mouseWidget->display()->containedWidget()->pick(displayPos);
|
||||
widget = mouseWidget->display()->containedWidget()->pickFromScreenPos(screenPos);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -853,6 +850,16 @@ Window* Manager::getTopWindow()
|
||||
return static_cast<Window*>(UI_FIRST_WIDGET(children()));
|
||||
}
|
||||
|
||||
Window* Manager::getDesktopWindow()
|
||||
{
|
||||
for (auto child : children()) {
|
||||
Window* window = static_cast<Window*>(child);
|
||||
if (window->isDesktop())
|
||||
return window;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Window* Manager::getForegroundWindow()
|
||||
{
|
||||
for (auto child : children()) {
|
||||
|
@ -61,6 +61,7 @@ namespace ui {
|
||||
void collectGarbage();
|
||||
|
||||
Window* getTopWindow();
|
||||
Window* getDesktopWindow();
|
||||
Window* getForegroundWindow();
|
||||
Display* getForegroundDisplay();
|
||||
|
||||
|
@ -1102,6 +1102,14 @@ bool Widget::paintEvent(Graphics* graphics,
|
||||
Widget* parentWidget;
|
||||
if (type() == kWindowWidget) {
|
||||
parentWidget = display()->containedWidget();
|
||||
|
||||
// Draw the desktop window as the background, not the manager
|
||||
// (as the manager contains all windows as children and will try
|
||||
// to draw other foreground windows here).
|
||||
if (get_multiple_displays() &&
|
||||
parentWidget->type() == kManagerWidget) {
|
||||
parentWidget = static_cast<Manager*>(parentWidget)->getDesktopWindow();
|
||||
}
|
||||
}
|
||||
else {
|
||||
parentWidget = parent();
|
||||
|
Loading…
Reference in New Issue
Block a user