aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text.cpp1
-rw-r--r--src/main.cpp13
2 files changed, 8 insertions, 6 deletions
diff --git a/src/Text.cpp b/src/Text.cpp
index 3aa1574..2292a4e 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -22,6 +22,7 @@ namespace dchat
Text::Text(const sf::Font *_font) :
font(_font),
characterSize(0),
+ vertices(sf::PrimitiveType::Quads),
maxWidth(0.0f),
color(sf::Color::White),
urlColor(URL_COLOR),
diff --git a/src/main.cpp b/src/main.cpp
index a66945c..4440315 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -659,11 +659,11 @@ int main(int argc, char **argv)
Channel::getCurrent()->addLocalMessage(msg, Channel::getCurrent()->getSystemUser());
});
- sf::Event event;
while (window.isOpen())
{
Channel *currentChannel = Channel::getCurrent();
+ sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
@@ -695,11 +695,12 @@ int main(int argc, char **argv)
if(focused)
{
ImagePreview::processEvent(event);
- if(!ImagePreview::getPreviewContentPtr() && ImagePreview::getTimeSinceLastSeenMs() > 250)
- {
- GlobalContextMenu::processEvent(event);
- currentChannel->processEvent(event, cache);
- }
+ }
+
+ if(!ImagePreview::getPreviewContentPtr() && ImagePreview::getTimeSinceLastSeenMs() > 250)
+ {
+ GlobalContextMenu::processEvent(event);
+ currentChannel->processEvent(event, cache);
}
}