mirror of
https://github.com/mpv-player/mpv
synced 2024-12-21 22:30:22 +00:00
a35a5bb5f3
Scale the window by the assumed DPI scaling factor, using 96 DPI as base. For example, a screen that reports 192 DPI is assumed to have a DPI scale factor 2. The window will then be created with twice the size. For robustness reasons, we accept only integer DPI scales between 1 and 9. We also error out if the X and Y scales are very different, as this most likely indicates a multiscreen system with botched size reporting. I'm not sure if reading the X server's DPI is such a good idea - maybe the Xrdb "Xft.dpi" value should be used instead. The current method follows what xdpyinfo does. This can be disabled with --hidpi-window-scale=no.
33 lines
1006 B
C
33 lines
1006 B
C
#ifndef MP_WIN_STATE_H_
|
|
#define MP_WIN_STATE_H_
|
|
|
|
#include "common/common.h"
|
|
|
|
struct vo;
|
|
|
|
enum {
|
|
// By user settings, the window manager's chosen window position should
|
|
// be overridden.
|
|
VO_WIN_FORCE_POS = (1 << 0),
|
|
};
|
|
|
|
struct vo_win_geometry {
|
|
// Bitfield of VO_WIN_* flags
|
|
int flags;
|
|
// Position & size of the window. In xinerama coordinates, i.e. they're
|
|
// relative to the virtual desktop encompassing all screens, not the
|
|
// current screen.
|
|
struct mp_rect win;
|
|
// Aspect ratio of the current monitor.
|
|
// (calculated from screen size and options.)
|
|
double monitor_par;
|
|
};
|
|
|
|
void vo_calc_window_geometry(struct vo *vo, const struct mp_rect *screen,
|
|
struct vo_win_geometry *out_geo);
|
|
void vo_calc_window_geometry2(struct vo *vo, const struct mp_rect *screen,
|
|
double dpi_scale, struct vo_win_geometry *out_geo);
|
|
void vo_apply_window_geometry(struct vo *vo, const struct vo_win_geometry *geo);
|
|
|
|
#endif
|