Fix scrollbars not updating while mouse pressed on Windows
This commit is contained in:
@@ -335,18 +335,21 @@ void Mouse_Pressed() {
|
||||
location mousePos(event.mouseButton.x, event.mouseButton.y);
|
||||
volatile bool doneScrolling = false;
|
||||
if(mousePos.in(text_sbar->getBounds())) {
|
||||
mainPtr.setActive(false);
|
||||
boost::thread updater(std::bind(handleUpdateWhileScrolling, std::ref(doneScrolling), REFRESH_TRANS));
|
||||
text_sbar->handleClick(mousePos);
|
||||
doneScrolling = true;
|
||||
updater.join();
|
||||
redraw_screen(REFRESH_TRANS);
|
||||
} else if(mousePos.in(item_sbar->getBounds())) {
|
||||
mainPtr.setActive(false);
|
||||
boost::thread updater(std::bind(handleUpdateWhileScrolling, std::ref(doneScrolling), REFRESH_INVEN));
|
||||
item_sbar->handleClick(mousePos);
|
||||
doneScrolling = true;
|
||||
updater.join();
|
||||
redraw_screen(REFRESH_INVEN);
|
||||
} else if(overall_mode == MODE_SHOPPING && mousePos.in(shop_sbar->getBounds())) {
|
||||
mainPtr.setActive(false);
|
||||
boost::thread updater(std::bind(handleUpdateWhileScrolling, std::ref(doneScrolling), REFRESH_DLOG));
|
||||
shop_sbar->handleClick(mousePos);
|
||||
doneScrolling = true;
|
||||
|
@@ -68,7 +68,6 @@ bool cScrollbar::handleClick(location where) {
|
||||
if(max == 0) return false;
|
||||
sf::Event e;
|
||||
bool done = false, clicked = false;
|
||||
inWindow->setActive();
|
||||
depressed = true;
|
||||
int bar_height = frame.height() - 32;
|
||||
rectangle thumbRect = frame;
|
||||
|
@@ -563,12 +563,14 @@ void Mouse_Pressed() {
|
||||
location mousePos(event.mouseButton.x, event.mouseButton.y);
|
||||
volatile bool doneScrolling = false;
|
||||
if(right_sbar->isVisible() && mousePos.in(right_sbar->getBounds())) {
|
||||
mainPtr.setActive(false);
|
||||
boost::thread updater(std::bind(handleUpdateWhileScrolling, std::ref(doneScrolling)));
|
||||
right_sbar->handleClick(mousePos);
|
||||
doneScrolling = true;
|
||||
updater.join();
|
||||
redraw_screen(/*REFRESH_RIGHT_BAR*/);
|
||||
} else if(pal_sbar->isVisible() && mousePos.in(pal_sbar->getBounds())) {
|
||||
mainPtr.setActive(false);
|
||||
boost::thread updater(std::bind(handleUpdateWhileScrolling, std::ref(doneScrolling)));
|
||||
pal_sbar->handleClick(mousePos);
|
||||
doneScrolling = true;
|
||||
|
Reference in New Issue
Block a user