mirror of https://github.com/mpv-player/mpv
w32_common: avoid unnecessary sprintfs
These were unnecessary for a couple of reasons, but it seems like the old code went through a lot of effort to avoid duplicating the code to print a RECT, even though the windowrc gets printed anyway at the end of the function. Avoid printing the same windowrc twice by only printing it when it gets changed (in the w32->current_fs branch.)
This commit is contained in:
parent
91c1691b35
commit
c754c31d6f
|
@ -842,19 +842,16 @@ static bool update_fullscreen_state(struct vo_w32_state *w32)
|
|||
w32->current_fs = new_fs;
|
||||
|
||||
if (toggle_fs) {
|
||||
RECT rc;
|
||||
char msg[50];
|
||||
if (w32->current_fs) {
|
||||
// Save window rect when switching to fullscreen.
|
||||
rc = w32->prev_windowrc = w32->windowrc;
|
||||
sprintf(msg, "save window bounds");
|
||||
w32->prev_windowrc = w32->windowrc;
|
||||
MP_VERBOSE(w32, "save window bounds: %d:%d:%d:%d\n",
|
||||
(int)w32->windowrc.left, (int)w32->windowrc.top,
|
||||
(int)rect_w(w32->windowrc), (int)rect_h(w32->windowrc));
|
||||
} else {
|
||||
// Restore window rect when switching from fullscreen.
|
||||
rc = w32->windowrc = w32->prev_windowrc;
|
||||
sprintf(msg, "restore window bounds");
|
||||
w32->windowrc = w32->prev_windowrc;
|
||||
}
|
||||
MP_VERBOSE(w32, "%s: %d:%d:%d:%d\n", msg,
|
||||
(int)rc.left, (int)rc.top, (int)rect_w(rc), (int)rect_h(rc));
|
||||
}
|
||||
|
||||
if (w32->current_fs)
|
||||
|
|
Loading…
Reference in New Issue