2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2010 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2010-04-22 04:28:34 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2010-04-22 04:28:34 +00:00
|
|
|
|
2017-02-25 03:56:33 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2021-02-22 13:32:53 +00:00
|
|
|
#ifdef HAVE_XRANDR
|
2010-04-22 04:28:34 +00:00
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
#endif
|
2017-09-09 18:49:20 +00:00
|
|
|
#include <X11/Xlib.h>
|
2014-02-19 01:56:29 +00:00
|
|
|
|
2010-04-22 04:28:34 +00:00
|
|
|
// EWMH state actions, see
|
|
|
|
// http://freedesktop.org/wiki/Specifications/wm-spec?action=show&redirect=Standards%2Fwm-spec
|
2011-02-09 03:12:05 +00:00
|
|
|
#define _NET_WM_STATE_REMOVE 0 // remove/unset property
|
|
|
|
#define _NET_WM_STATE_ADD 1 // add/set property
|
|
|
|
#define _NET_WM_STATE_TOGGLE 2 // toggle property
|
2010-04-22 04:28:34 +00:00
|
|
|
|
|
|
|
namespace X11Utils
|
|
|
|
{
|
2015-01-04 16:09:56 +00:00
|
|
|
bool ToggleFullscreen(Display* dpy, Window win);
|
2010-11-25 02:26:46 +00:00
|
|
|
|
2021-02-22 13:32:53 +00:00
|
|
|
#ifdef HAVE_XRANDR
|
2010-04-22 04:28:34 +00:00
|
|
|
class XRRConfiguration
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
XRRConfiguration(Display* _dpy, Window _win);
|
|
|
|
~XRRConfiguration();
|
|
|
|
|
|
|
|
void Update();
|
|
|
|
void ToggleDisplayMode(bool bFullscreen);
|
2014-08-06 19:45:40 +00:00
|
|
|
void AddResolutions(std::vector<std::string>& resos);
|
2010-04-22 04:28:34 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Display* dpy;
|
|
|
|
Window win;
|
2011-02-09 03:12:05 +00:00
|
|
|
int screen;
|
|
|
|
XRRScreenResources* screenResources;
|
|
|
|
XRROutputInfo* outputInfo;
|
|
|
|
XRRCrtcInfo* crtcInfo;
|
|
|
|
RRMode fullMode;
|
|
|
|
int fb_width, fb_height, fb_width_mm, fb_height_mm;
|
|
|
|
int fs_fb_width, fs_fb_height, fs_fb_width_mm, fs_fb_height_mm;
|
2010-07-10 12:35:16 +00:00
|
|
|
bool bValid;
|
2011-02-09 03:12:05 +00:00
|
|
|
bool bIsFullscreen;
|
2010-04-22 04:28:34 +00:00
|
|
|
};
|
|
|
|
#endif
|
2019-05-05 23:48:12 +00:00
|
|
|
} // namespace X11Utils
|