2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2010 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2014-02-10 11:54:46 -07:00
|
|
|
// Refer to the license.txt file included.
|
2010-04-21 22:28:34 -06:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2010-04-21 22:28:34 -06:00
|
|
|
|
2017-02-24 20:56:33 -07:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2021-02-22 06:32:53 -07:00
|
|
|
#ifdef HAVE_XRANDR
|
2010-04-21 22:28:34 -06:00
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
#endif
|
2017-09-09 12:49:20 -06:00
|
|
|
#include <X11/Xlib.h>
|
2014-02-18 18:56:29 -07:00
|
|
|
|
2010-04-21 22:28:34 -06:00
|
|
|
// EWMH state actions, see
|
|
|
|
// http://freedesktop.org/wiki/Specifications/wm-spec?action=show&redirect=Standards%2Fwm-spec
|
2011-02-08 20:12:05 -07: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-21 22:28:34 -06:00
|
|
|
|
|
|
|
namespace X11Utils
|
|
|
|
{
|
2015-01-04 09:09:56 -07:00
|
|
|
bool ToggleFullscreen(Display* dpy, Window win);
|
2010-04-21 22:28:34 -06:00
|
|
|
Window XWindowFromHandle(void* Handle);
|
|
|
|
Display* XDisplayFromHandle(void* Handle);
|
|
|
|
|
2018-04-14 08:48:49 -06:00
|
|
|
void InhibitScreensaver(Window win, bool suspend);
|
2010-11-24 19:26:46 -07:00
|
|
|
|
2021-02-22 06:32:53 -07:00
|
|
|
#ifdef HAVE_XRANDR
|
2010-04-21 22:28:34 -06:00
|
|
|
class XRRConfiguration
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
XRRConfiguration(Display* _dpy, Window _win);
|
|
|
|
~XRRConfiguration();
|
|
|
|
|
|
|
|
void Update();
|
|
|
|
void ToggleDisplayMode(bool bFullscreen);
|
2014-08-06 13:45:40 -06:00
|
|
|
void AddResolutions(std::vector<std::string>& resos);
|
2010-04-21 22:28:34 -06:00
|
|
|
|
|
|
|
private:
|
|
|
|
Display* dpy;
|
|
|
|
Window win;
|
2011-02-08 20:12:05 -07: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 06:35:16 -06:00
|
|
|
bool bValid;
|
2011-02-08 20:12:05 -07:00
|
|
|
bool bIsFullscreen;
|
2010-04-21 22:28:34 -06:00
|
|
|
};
|
|
|
|
#endif
|
2019-05-05 17:48:12 -06:00
|
|
|
} // namespace X11Utils
|