File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 112020-06-14 (0.12.19)
22 FLTK: line numbers colours #93
3+ SDL: restore window size #95
34
452020-06-06 (0.12.19)
56 COMMON: minor performance tweak
Original file line number Diff line number Diff line change @@ -804,6 +804,17 @@ char *Runtime::getClipboardText() {
804804 return result;
805805}
806806
807+ void Runtime::setActive (bool active) {
808+ setRunning (active);
809+ if (active) {
810+ setWindowRect (_saveRect);
811+ } else {
812+ SDL_SetWindowPosition (_window, _saveRect.x , _saveRect.y );
813+ SDL_SetWindowSize (_window, _saveRect.w , _saveRect.h );
814+ setWindowSize (_saveRect.w , _saveRect.h );
815+ }
816+ }
817+
807818//
808819// System platform methods
809820//
@@ -847,12 +858,12 @@ void maWait(int timeout) {
847858// sbasic implementation
848859//
849860int osd_devinit (void ) {
850- runtime->setRunning (true );
861+ runtime->setActive (true );
851862 return 1 ;
852863}
853864
854865int osd_devrestore (void ) {
855- runtime->setRunning (false );
866+ runtime->setActive (false );
856867 return 0 ;
857868}
858869
Original file line number Diff line number Diff line change @@ -58,11 +58,13 @@ struct Runtime : public System {
5858 char *getClipboardText ();
5959 void setWindowRect (SDL_Rect &rect);
6060 SDL_Rect getWindowRect ();
61+ void setActive (bool running);
6162
6263private:
6364 int _menuX, _menuY;
6465 bool _fullscreen;
6566 SDL_Rect _windowRect;
67+ SDL_Rect _saveRect;
6668 Graphics *_graphics;
6769 Stack<MAEvent *> *_eventQueue;
6870 SDL_Window *_window;
You can’t perform that action at this time.
0 commit comments