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