Correctly remember last used screen for secondary rt window in meow mode. Hopefully fixes also wrong width of toolpanel.
This commit is contained in:
parent
baf6693be6
commit
76dba8fc7b
@ -40,6 +40,11 @@ EditWindow* EditWindow::getInstance(RTWindow* p)
|
|||||||
|
|
||||||
explicit EditWindowInstance(RTWindow* p) : editWnd(p)
|
explicit EditWindowInstance(RTWindow* p) : editWnd(p)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static EditWindowInstance instance_(p);
|
||||||
|
if(!instance_.editWnd.is_maximized()) {
|
||||||
int meowMonitor = 0;
|
int meowMonitor = 0;
|
||||||
if(isMultiDisplayEnabled()) {
|
if(isMultiDisplayEnabled()) {
|
||||||
if(options.meowMonitor >= 0) { // use display from last session if available
|
if(options.meowMonitor >= 0) { // use display from last session if available
|
||||||
@ -50,14 +55,18 @@ EditWindow* EditWindow::getInstance(RTWindow* p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Gdk::Rectangle lMonitorRect;
|
Gdk::Rectangle lMonitorRect;
|
||||||
editWnd.get_screen()->get_monitor_geometry(meowMonitor, lMonitorRect);
|
instance_.editWnd.get_screen()->get_monitor_geometry(meowMonitor, lMonitorRect);
|
||||||
editWnd.move(lMonitorRect.get_x(), lMonitorRect.get_y());
|
instance_.editWnd.move(lMonitorRect.get_x(), lMonitorRect.get_y());
|
||||||
editWnd.maximize();
|
instance_.editWnd.maximize();
|
||||||
|
instance_.editWnd.show_all ();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Gdk::Screen::get_default()->get_n_monitors() == 1) {
|
||||||
|
// when using MEOW mode on a single monitor we need to present the secondary window.
|
||||||
|
// If we don't it will stay in background when opening 2nd, 3rd... editor, which is annoying
|
||||||
|
instance_.editWnd.present();
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
static EditWindowInstance instance_(p);
|
|
||||||
instance_.editWnd.show_all();
|
|
||||||
return &instance_.editWnd;
|
return &instance_.editWnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,7 +99,6 @@ EditWindow::EditWindow (RTWindow* p) : parent(p) , isFullscreen(false)
|
|||||||
mainBox->pack_start (*mainNB);
|
mainBox->pack_start (*mainNB);
|
||||||
|
|
||||||
add (*mainBox);
|
add (*mainBox);
|
||||||
show_all ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditWindow::on_realize ()
|
void EditWindow::on_realize ()
|
||||||
@ -252,7 +260,8 @@ bool EditWindow::on_delete_event(GdkEventAny* event)
|
|||||||
options.meowMonitor = get_screen()->get_monitor_at_window (get_window());
|
options.meowMonitor = get_screen()->get_monitor_at_window (get_window());
|
||||||
}
|
}
|
||||||
|
|
||||||
hide ();
|
hide();
|
||||||
|
unmaximize();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user