Commit Graph

153 Commits

Author SHA1 Message Date
orbea 1ddcc7be82 Ifdef the broken dbus code better. 2017-12-16 05:19:05 -08:00
gblues 6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
q3cpma 6e8fb49d05 Whoops 2017-12-01 00:17:50 +01:00
q3cpma fa3aab9768 Fixes compilation on FreeBSD (and hopefully on other POSIX platforms) 2017-11-30 16:53:55 +01:00
q3cpma 18b2bd527c Set _NET_WM_PID
Also set WM_CLIENT_MACHINE since https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html
says you must do so if setting the first.
2017-11-23 19:15:59 +01:00
twinaphex 060753258a Combine input_driver.c and input_keyboard.c 2017-06-11 17:51:12 +02:00
twinaphex ddf779008a Update 2017-05-20 19:48:02 +02:00
twinaphex 5a9dbf7e4f Merge keyboard files for udev/x11 2017-05-20 19:44:04 +02:00
twinaphex b0398c1482 C89 build fixes 2017-05-19 03:34:53 +02:00
twinaphex b97c8a183d Update log 2017-03-24 01:38:23 +01:00
twinaphex 7579d68272 Cleanups 2017-03-24 00:15:17 +01:00
twinaphex 62aa0c4415 Split up dbus functions into separate file 2017-03-24 00:12:21 +01:00
twinaphex 805470072b Make desktop_mode a static variable inside x11_common.c 2017-03-23 20:07:56 +01:00
twinaphex 1ce3b12335 Split up xinerama functions into separate files 2017-03-23 19:59:11 +01:00
twinaphex 09e7186a4e Start splitting up xinerama functions 2017-03-23 19:46:06 +01:00
twinaphex 4c0ce28e6e (x11_common.c) Cleanups 2017-03-23 19:36:39 +01:00
twinaphex 6247d6ea1d Update check_window - we no longer need runloop.h inside context driver 2017-01-23 01:02:33 +01:00
twinaphex 96c8ca5a09 Header update #1 2017-01-22 13:40:32 +01:00
twinaphex 6c108a8d27 Shows titlebar text again with X11 2017-01-19 17:58:00 +01:00
Brad Parker b44c8c9995 store buffer for window title, only update actual title when it changes 2017-01-19 00:33:52 -05:00
twinaphex 34da27c36b Don't need 'frame_count' variable for check_window 2017-01-18 21:47:12 +01:00
twinaphex 6247e9900b Remove another header include 2017-01-18 17:46:08 +01:00
twinaphex a6a4808e94 Refactor frame monitor code 2017-01-18 17:41:27 +01:00
twinaphex 23017e0b45 Cleanups 2017-01-13 16:57:57 +01:00
twinaphex 34d5f609f7 (x11_common.c) Cleanups 2017-01-10 21:54:48 +01:00
twinaphex 36fb6776b2 Don't grab settings pointer in video_monitor_get_fps function 2017-01-09 15:42:14 +01:00
twinaphex 3d92ce140e Pass video_frame_info_t to update_window_title 2017-01-09 14:42:07 +01:00
twinaphex 77e5cdbfde Revert "Rename runloop_msg_queue_push to video_driver_msg_queue_push"
This reverts commit ad7386913c.
2016-12-22 23:36:11 +01:00
twinaphex ad7386913c Rename runloop_msg_queue_push to video_driver_msg_queue_push
and move code to video_driver.c
2016-12-22 13:15:02 +01:00
twinaphex 5ca7344436 Get rid of more implicit memsets 2016-12-19 19:17:23 +01:00
twinaphex a5d4032d01 (X11) Cleanups 2016-12-15 12:37:14 +01:00
twinaphex 2f171c4b5d (x11_common.c) Cleanups 2016-12-04 03:39:51 +01:00
twinaphex c3ab8800f4 Prevent implicit memsets 2016-10-21 05:57:40 +02:00
twinaphex f75a604ae8 Fix C89_BUILD 2016-10-16 01:51:07 +02:00
Torsten Paul d4a90f267d Fix handling of enable flag for xdg-screensaver. 2016-10-10 19:01:41 +02:00
twinaphex 91b1889873 (X11) Mouse input is no longer registered when we are on the
titlebar of the window or we are no longer inside the window
2016-10-03 06:50:00 +02:00
twinaphex 7bd38d93f0 (X11) Cleanup x11_alive 2016-10-01 12:12:58 +02:00
twinaphex cb17c0f493 Style nits 2016-09-16 13:31:18 +02:00
Bastien Nocera 5afdd35e54 x11: Only call out to xdg-screensaver when D-Bus failed 2016-09-16 13:03:48 +02:00
Bastien Nocera a061b4a801 x11: Implement xdg-screensaver uninhibition 2016-09-16 13:03:37 +02:00
Bastien Nocera e563bd5512 x11: Flatten D-Bus (un)inhibit functions
Instead of nesting, try to exit as soon as possible in case of errors.
Also make sure to tell the caller whether the call succeeded and a
fallback should be attempted.
2016-09-16 12:59:16 +02:00
Bastien Nocera 297c9a8613 x11: Reset dbus_connection global variable on exit
To ensure that the state of the variable is correct. This won't be
needed if X11 is never reinitialised.
2016-09-16 12:34:15 +02:00
Bastien Nocera 6ab7fab326 x11: Lower the severity of D-Bus not being accessible
As there is a fallback through xdg-screensaver, no need to make this any
more important than a log message.
2016-09-16 12:32:22 +02:00
Bastien Nocera 65fa874c3a x11: Rename function fetching the D-Bus connection
You'd expect a "get" function to return the variable in question. This
doesn't, and simply sets a global variable.
2016-09-16 12:32:15 +02:00
Alcaro f6b7fc17f6 Those checks aren't needed. 2016-09-16 00:45:00 +02:00
twinaphex 1b46f3c344 Nits 2016-09-14 15:58:53 +02:00
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
twinaphex 9ece4db168 (x11_common.c) Move variables and macros to top 2015-11-16 06:59:23 +01:00
twinaphex 1acc7226f9 Rearrange headers 2015-09-16 11:24:03 +02:00
twinaphex f88575633e Cleanups 2015-09-05 20:34:22 +02:00
Alcaro febcbc5ce4 C89 cleanups part 2 2015-06-26 17:48:43 +02:00