57 Commits

Author SHA1 Message Date
twinaphex
f87dbe7946 Style nits/cleanups 2016-09-14 15:58:03 +02:00
twinaphex
ca673b4fc8 C89_BUILD fixes etc. 2016-09-14 15:56:14 +02:00
nguillaumin
c69c488fdf Address code review comments 2016-09-09 18:08:54 -07:00
Nicolas Guillaumin
05df632bd8 WIP: Fixes #2026 Screensaver suspend on Linux via Dbus
One some systems (tested with Gnome 3 on Arch Linux) the current method
of using `xdg-screensaver` to suspend the screensaver does not work.
Instead, using DBus to issue an `Inhibit` request is recommended.

The request returns a cookie that needs to be re-used to un-inhibit the
screensaver later. Additionally if the DBus connection is closed the
current inhibition is discarded. Thus, the DBus connection needs to stay
connected for the duration of the screenshot inhibition.

The code is heavily inspired from the [SDL 2.x
code](http://hg.libsdl.org/SDL/file/default/src/core/linux/SDL_dbus.c#l172).
I didn't call the SDL 2 code though since this it to fix the issue with
the GL driver, and I assume one would want to have screensaver inhibited
even when SDL 2 is not available (but GL is).

I've set "WIP" because:
* I haven't done C in a long time so my code is probably not great
* There's a dependency on DBus which I don't know is acceptable or
not
* I've put my code where I could to check it works, but `x11_common` may
not be the best place
* The code need and "init" and "deinit" kind of method as it needs to
initialise the DBus connection, and on deinit close it properly. I've
used `x11_connect` and `x11_window_destroy` but they don't sound like
the best choices.
* I'm a bit unclear as to what happens when "suspend screensaver" is
ticked on/off in the menu. This doesn't seem to call
`x11_suspend_screensaver` everytime, so I'm not sure if there's a hook
somewhere (as disabling screensaver suspend in the menu should cause a
DBus unhinibit request to be sent).
* Should I just call the SDL 2.x code (meaning that the GL driver would
depend on SDL 2.x at runtime)?

So, first of all are you ok with the approach, and if yes I'd gladly get
feedback about the code, how to architecture it and the best place to
put it.

Thanks!
2016-09-08 15:23:41 -07:00
twinaphex
b43f786f89 Cleanups 2016-09-08 08:15:40 +02:00
twinaphex
b580599710 (X11) Fix 'quit' button not working 2016-07-09 12:09:39 +02:00
twinaphex
76cc6fd8ec Start implementing signal handler code once in frontend driver code 2016-07-08 02:38:33 +02:00
twinaphex
7d12408f24 x11_create_input_context - prevent memleak 2016-05-26 07:34:25 +02:00
twinaphex
9c1885a46e Fix Display FPS 2016-05-08 22:00:30 +02:00
Torsten Paul
1979ea52d2 Suppress screensaver only if requested by user settings. 2016-05-08 19:22:45 +02:00
Torsten Paul
ccb224043b Initialize window name at window creation time (fixes #1521).
The protocol error reported in #1521 is caused by two different issues.
First xdg-screensaver fails to parse decimal values for the window id
(https://bugzilla.redhat.com/show_bug.cgi?id=1274931). Using the hex
notation fixes this part.

Second, the script reads the WM_NAME property from the window which is
not yet available at this time. Calling x11_update_window_title() early
ensures the property is set when xdg-screensaver is run.
2016-05-06 00:17:47 +02:00
twinaphex
ca63357b54 (X11) Do not keep appending to suspend screensaver if not available 2016-03-21 19:12:16 +01:00
twinaphex
6f80e09ce1 Change MIN/MAX to upper-case 2016-03-02 00:07:31 +01:00
Alcaro
7a6463a300 Add escape hatch if rarch (or the core) is in an infinite loop. 2016-02-23 16:11:39 +01:00
twinaphex
2fa46bcef8 Cleanups 2016-02-05 13:36:18 +01:00
twinaphex
54f46f4ee3 Update headers 2016-01-10 04:41:52 +01:00
twinaphex
2d55dc3bda Complete namespace changes 2015-12-07 15:32:14 +01:00
twinaphex
6c6beca430 Create x11_save_last_used_monitor 2015-12-01 08:49:35 +01:00
twinaphex
c4354ff429 Create g_x11_screen 2015-12-01 08:42:33 +01:00
twinaphex
a02728fee3 Cleanups 2015-11-29 03:35:19 +01:00
twinaphex
9fd9fd10e8 Create input_x11_common 2015-11-29 03:34:09 +01:00
twinaphex
0044d853f8 Move display_type / display_window etc all to gfx/video_driver.c -
no more dependencies on driver_t
2015-11-29 01:12:49 +01:00
twinaphex
074f14b132 Add verbosity.c/verbosity.h 2015-11-23 12:03:38 +01:00
twinaphex
85dbeeb8f9 No more video_monitor.h 2015-11-22 13:32:46 +01:00
twinaphex
00be95159d Create x11_event_queue_check 2015-11-19 15:05:17 +01:00
twinaphex
2810f82296 x11_common.c - reorder variables 2015-11-19 12:23:49 +01:00
twinaphex
c8130120bc Turn g_x11_has_focus into static variable 2015-11-19 12:23:01 +01:00
twinaphex
655520aeec Create x11_install_quit_atom 2015-11-19 12:18:35 +01:00
twinaphex
e3aba24e42 (X11) Code de-duplication 2015-11-19 12:05:32 +01:00
twinaphex
50cd3bc185 Create x11_colormap_destroy 2015-11-19 11:55:05 +01:00
twinaphex
48495980ba Create x11_window_destroy 2015-11-19 11:49:09 +01:00
twinaphex
268570a108 Make g_x11_xim and g_x11_xic both static 2015-11-19 11:28:41 +01:00
twinaphex
ce2b973beb Create x11_input_ctx_new/x11_input_ctx_destroy 2015-11-19 11:27:41 +01:00
twinaphex
56e5d0bf3e Create g_x11_xim 2015-11-19 11:24:56 +01:00
twinaphex
f868cbab31 Create x11_update_window_title 2015-11-19 11:18:57 +01:00
twinaphex
d23557d38e Start restricting scope of g_x11_has_focus 2015-11-19 11:13:59 +01:00
twinaphex
91144ed53f Turn g_x11_quit into static variable 2015-11-19 11:08:38 +01:00
twinaphex
f364ff0649 Create x11_connect 2015-11-19 11:07:52 +01:00
twinaphex
95a5818ccb Create x11_install_sighandlers 2015-11-19 11:04:17 +01:00
twinaphex
8480bc3c19 Create x11_alive - get rid of some code duplication in xvideo.c 2015-11-19 10:46:16 +01:00
twinaphex
dd3e7f9ddc No more wrapper function for x11_check_window 2015-11-19 10:35:15 +01:00
twinaphex
b50152902a No wrapper functions anymore for x11_get_video_size 2015-11-19 10:29:26 +01:00
twinaphex
9563f40aeb Cleanups 2015-11-19 10:25:07 +01:00
twinaphex
ba1dd31995 Create x11_has_focus 2015-11-19 10:13:09 +01:00
twinaphex
cbaca1bfe1 Create x11_get_video_size 2015-11-19 10:09:19 +01:00
twinaphex
5283c4c13c (GLX) Uses x11_check_window now too 2015-11-19 10:05:54 +01:00
twinaphex
ac6813dc7f Create x11_check_window 2015-11-19 10:02:53 +01:00
twinaphex
025db14dcf (XEGL/GLX) Start using the same global state variables 2015-11-19 10:00:25 +01:00
twinaphex
3f23a23dea move g_has_focus to x11_common.c 2015-11-19 09:51:20 +01:00
twinaphex
c9dc5cf71d Start moving some global variables for X11 context drivers
to x11_common.c
2015-11-19 09:49:37 +01:00