Skip to content

Commit

Permalink
Maintain window position, size and display after toggling window frame.
Browse files Browse the repository at this point in the history
  • Loading branch information
acaudwell committed Oct 9, 2015
1 parent 78c5c15 commit a1041fd
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core
Submodule core updated 1 files
+43 −8 display.cpp
23 changes: 21 additions & 2 deletions src/logstalgia.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void Logstalgia::keyPress(SDL_KeyboardEvent *e) {
}

if (e->keysym.sym == SDLK_F11) {
display.toggleFrameless();
toggleWindowFrame();
}

if (e->keysym.sym == SDLK_F12) {
Expand Down Expand Up @@ -720,6 +720,25 @@ void Logstalgia::resize(int width, int height) {
reinit();
}

void Logstalgia::toggleWindowFrame() {
#if SDL_VERSION_ATLEAST(2,0,0)
if(display.fullscreen) return;
if(frameExporter != 0) return;

texturemanager.unload();
shadermanager.unload();
fontmanager.unload();

display.toggleFrameless();

texturemanager.reload();
shadermanager.reload();
fontmanager.reload();

reinit();
#endif
}

void Logstalgia::reinit() {
initPaddles();
initRequestBalls();
Expand Down Expand Up @@ -1118,7 +1137,7 @@ void Logstalgia::addGroup(const std::string& group_by, const std::string& groupt

try {
summarizer = new Summarizer(fontSmall, percent, settings.update_rate, groupregex, grouptitle);
}
}
catch(RegexCompilationException& e) {
throw SDLAppException("invalid regular expression for group '%s'", grouptitle.c_str());
}
Expand Down
1 change: 1 addition & 0 deletions src/logstalgia.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ class Logstalgia : public SDLApp {
void setBackground(vec3 background);

void resize(int width, int height);
void toggleWindowFrame();

//inherited methods
void init();
Expand Down

0 comments on commit a1041fd

Please sign in to comment.