summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
Commit message (Collapse)AuthorAgeFilesLines
* buid: readd -Wparentheseswm42015-03-021-1/+1
| | | | | | | | | This warning wasn't overly helpful in the past, and warned against perfectly fine code. But at least with recent gcc versions, this is the warning that complains about assignments in if expressions (why???), so we want to enable it. Also change all the code this warning complains about for no reason.
* input: add MOUSE_ENTER keybinding.torque2015-02-181-0/+1
| | | | Signed-off-by: wm4 <wm4@nowhere>
* command: unify handling of fullscreen and other VO flagswm42015-01-161-0/+1
| | | | | | | | The "ontop" and "border" properties already used a common mp_property_vo_flag() function, and the corresponding VOCTRLs used the same conventions. "fullscreen" is pretty similar, but was handled slightly similar. Change how VOCTRL_FULLSCREEN behaves, and use the same helper function for "fullscreen" as the other flags.
* wayland: implement key modifierswm42015-01-121-18/+24
| | | | Includes shift, ctrl, alt, meta.
* wayland: don't compute absurd window sizewm42015-01-121-3/+6
| | | | | | | | | For some reason, schedule_resize() can be called with everything set to 0. The code couldn't handle wl->window.aspect set to 0, converting NaNs to integers. Just work this around. (I have no idea what I'm doing. This is probably a corner case caused by my broken-ish wayland setup.)
* vo_wayland: Add "multimedia" keyboard key bindings.Sergey Kvachonok2014-11-291-0/+14
| | | | | | | | libxkbcommon keysyms are the same as X11 keysyms (sans prefix), so I simply copied the missing subsection from x11_common.c. Signed-off-by: Sergey Kvachonok <ravenexp@gmail.com> Signed-off-by: wm4 <wm4@nowhere>
* wayland: use reported rete and delayAlexander Preisinger2014-09-191-2/+27
| | | | | If native-keyrepeat is true then we set the rate and delay reported by the compositor.
* wayland_common: fix changing videos when fullscreenAlexander Preisinger2014-09-101-14/+3
| | | | I broke it again.
* video: rename VOCTRL_GET_WINDOW_SIZEwm42014-09-051-2/+2
| | | | Make it clear that this accesses the un-fullscreened window size.
* wayland: print some useful outptu infoAlexander Preisinger2014-09-031-15/+19
| | | | | Prints output informations, useful for finding out if we detect the right mode and for debugging.
* wayland: only save current mode of outputsAlexander Preisinger2014-09-031-1/+2
| | | | Other ones are not needed.
* Move compat/ and bstr/ directory contents somewhere elsewm42014-08-291-1/+1
| | | | | | | | | bstr.c doesn't really deserve its own directory, and compat had just a few files, most of which may as well be in osdep. There isn't really any justification for these extra directories, so get rid of them. The compat/libav.h was empty - just delete it. We changed our approach to API compatibility, and will likely not need it anymore.
* wayland: replace deprecated xkbcommon functionsAlexander Preisinger2014-08-201-3/+3
| | | | Available and stable since forever (xkbcommon 0.2).
* wayland: dynamically report display fpsAlexander Preisinger2014-08-181-20/+58
| | | | | | | | Only reports the most recently entered output if the window is displayed on 2 or more outputs. Should be changed to the lowest fps of all outputs the window is visible. Until no one complains this will have to wait. Look for the VO framedropping for more information on this topic.
* wayland: pointer interface is created after themeAlexander Preisinger2014-08-131-13/+8
| | | | | | | | Just always load the theme. It gets freed properly and dosn't bother anyone. Fixes #1012. CC: @mpv-player/stable
* wayland: remove redundant lineAlexander Preisinger2014-08-061-1/+0
|
* wayland: changes for nested compositorsAlexander Preisinger2014-08-061-20/+50
| | | | | Adds necessary checks for nested compositors which only have limited interfaces. Might also be useful for other minimal compositors.
* vo: remove vo_mouse_movement() wrapperwm42014-07-271-2/+2
| | | | So that VO backends don't have to access the VO just for that.
* wayland: move subsurfaces to wayland voAlexander Preisinger2014-06-151-20/+3
| | | | | | | Subsurfaces are only used by the wayland vo. Thats why it makes sense to move all osd and subsurface specific parts to the vo_wayland.c Also destroy the subsurfaces and subcompositor properly.
* wayland: attach NULL surface on osd creationAlexander Preisinger2014-06-151-0/+3
| | | | | | | When using the EGL output the subsurfaces have no buffer attached and the size seems to be infinite. Fix this by attaching a NULL buffer. Fixes #846
* Add more constwm42014-06-111-2/+1
| | | | | | | While I'm not very fond of "const", it's important for declarations (it decides whether a symbol is emitted in a read-only or read/write section). Fix all these cases, so we have writeable global data only when we really need.
* wayland: remove stub for unimplemented functionwm42014-06-021-15/+0
|
* wayland: fix typoAlexander Preisinger2014-05-141-14/+14
| | | | So long in the code without me noticing. Embarassing!
* wayland: fix unchecked malloc usagewm42014-05-111-3/+9
| | | | | | | Found by cppcheck. Actually untested. (This is the file drag&drop code, I don't even know which wayland clients support this.)
* wayland: don't use VOCTRL_UPDATE_SCREENINFOwm42014-05-061-19/+22
| | | | Not very tested. Appears to work.
* Revert "wayland: print waylands display erros"Alexander Preisinger2014-04-261-39/+0
| | | | | | | | | | | | This reverts commit 6e34b0ec1f50612cb2767da3dbc27be0be63041d. There has always been an error message "proxy already has a listener" and I couldn't reproduce where it is comming from until now. The display interface already has a listener and we can't overwrite it. Now remove the code and avoid this error message. Conflicts: video/out/wayland_common.c
* Fix some libav* include statementswm42014-04-191-1/+0
| | | | | | | | | | | | | Fix all include statements of the form: #include "libav.../..." These come from MPlayer times, when FFmpeg was somehow part of the MPlayer build tree, and this form was needed to prefer the local files over system FFmpeg. In some cases, the include statement wasn't needed or could be replaced with mpv defined symbols.
* wayland: unset input regions for osdAlexander Preisinger2014-04-161-0/+4
| | | | | Set a zero sized input region for the osd surfaces in order to avoid getting input for the subsurfaces which might dissapear any time.
* wayland/shm: Use subsurfaces for OSDAlexander Preisinger2014-04-161-5/+25
|
* wayland: don't schedule resize if going fullscreenRicardo Vieira2014-04-131-1/+0
| | | | mpv was resizing to the same size before it went to fullscreen, we don't need to schedule a resize because the compositor will send a configure event with the new dimensions and thats when we should do it.
* video/out: simplify monitor aspect handlingwm42014-01-111-2/+0
| | | | | | | | For some reason, this made all VO backends both set the screen resolution in opts->screenwidth/height, and call aspect_save_screenres(). Remove the latter. Move the code to calculate the PAR-corrected window size from aspect.c to vo.c, and make it so that the monitor PAR is recalculated when it makes sense.
* wayland: properly empty output listAlexander Preisinger2014-01-081-4/+4
|
* wayland: fix crash when initialization failswm42014-01-081-1/+2
| | | | | | On X11, if no wayland compositor is running, wl_list_init() will never be called. This will cause destroy_display() to segfault when trying to iterate over the list.
* wayland: fix memory leaksAlexander Preisinger2014-01-081-0/+18
| | | | | There are still some leaks from wayland-cursor stuff, but there is no way to free the memory as user of the cursor library.
* wayland: cleanup registry_handle_globalAlexander Preisinger2014-01-081-2/+1
| | | | | The wl_registry object is already passed as a parameter. No need to create a temporary variable.
* wayland: remove set_user_data from seat_listenerAlexander Preisinger2014-01-081-2/+0
| | | | | | | | | The user_data is passed on add_listener and can later be changed with set_user_data. But because we don't want to change it later and because it is the same object remove the set_user_data call. This might be a copy&paste leftover from the initial draft for the wayland backend.
* wayland: use static consistentlyAlexander Preisinger2014-01-081-4/+4
| | | | Declare everything that is only needed inside wayland_common.c as static.
* wayland: fix fullscreen & resizing for goodAlexander Preisinger2014-01-071-11/+27
| | | | | | | I added enough logic to never set ontop or fullscreen twitce. This commit keeps also the size of the video if multiple videos are played. If the ratio differs the width will be kept at the same size and only the height changes.
* wayland: silence annoying libwayland-client messagewm42014-01-071-0/+3
| | | | | | | | | | | | | | | | | libwayland-client contains the following code [1]: runtime_dir = getenv("XDG_RUNTIME_DIR"); if (!runtime_dir) { fprintf(stderr, "error: XDG_RUNTIME_DIR not set in the environment.\n"); This means this message will unconditionally and unavoidably be printed if XDG_RUNTIME_DIR is not set. Since mpv is a terminal program, and we want to avoid unnecessary output, work it around by not attempting to use wayland if this environment variable is not set. [1] http://cgit.freedesktop.org/wayland/wayland/tree/src/wayland-client.c#n636 (cd0dccd01e16fa404e03974d30ded3aebdb1c4bc)
* wayland: fix some memory leaks on initialization failurewm42014-01-071-6/+13
| | | | | | | | | | | This commonly happens when initializing vo_opengl on a X11-only system. Unfortunately, most wl_*_destroy() functions appear not to accept NULL pointers, making partial deinitialization a pain: you have to add your own NULL checks everywhere to avoid crashes. xkb.context is uninitialized separately, because you can initialize it just fine, even if the rest of input initialization fails.
* wayland: remove workaroundAlexander Preisinger2014-01-041-6/+3
| | | | | | | | The changes in the vo_wayland_ontop function have no effect on the workaround. Somehow the problem just disappeared. I guess it is because of the new control function in gl_wayland.c where the resize happens immediatly after the event dispatch/flush.
* wayland: fix obvious bug in dnd codeAlexander Preisinger2014-01-041-1/+1
| | | | I still don't think this is the right approach.
* video/out: remove some code duplication between X11 and waylandwm42014-01-041-25/+2
| | | | | | Both X11 and Wayland support the same format for drag & drop operations (text/uri-list), and the code for that was copied from x11_common.c to wayland_common.c. Factor it out.
* input: move files drag and drop to a new event.c fileStefano Pigozzi2014-01-041-1/+2
| | | | | event.c will be used to feed the input queue with 'global' events that don't mesh well with the usual check_events path in mpv.
* wayland: move workaround to fullscreen codeAlexander Preisinger2014-01-041-4/+5
| | | | | Because of this workaround there was a bug in the wayland vo. Now it works on both vos (opengl and shm) as it should.
* wayland: implement dropping files on the VO windowAlexander Preisinger2014-01-041-2/+185
| | | | Needs some proper testing.
* wayland/opengl: fix garbage bordersAlexander Preisinger2014-01-021-21/+22
| | | | | It seems mpv draws garbage in those regions. Now we calculate the aspect and let weston draw the black borders.
* wayland: don't change set fullscreen twiceAlexander Preisinger2014-01-021-1/+1
| | | | | Newest weston chrashes if we call set_fullscreen twice. This is a major bug I which I should probably report.
* Split mpvcore/ into common/, misc/, bstr/wm42013-12-171-2/+2
|
* Move options/config related files from mpvcore/ to options/wm42013-12-171-1/+1
| | | | | | | | | Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.
* Move mpvcore/input/ to input/wm42013-12-171-2/+2
|
* wayland: print waylands display errosAlexander Preisinger2013-12-041-0/+40
| | | | | This is very usefull especially if you want to use newer wayland stuff like wl_subsurfaces and xdg_surfaces.
* wayland: create xkbcommon keymap from stringAlexander Preisinger2013-11-131-2/+1
| | | | Fixes a problem where the passed size doesn't match the actuall string.
* waylad: implement functionality for window-scalingAlexander Preisinger2013-11-121-0/+12
|
* wayland: better name for mouse coordinatesAlexander Preisinger2013-10-251-5/+5
| | | | | I had to look up what the surf_x and surf_y members do. That means the name is not very good. Also a comment.
* wayland: fix fullscreen transparent border regionsAlexander Preisinger2013-10-251-22/+28
| | | | | | | The default behavior of weston changed some time ago to not fill the surface black for fullscreen windows. Now let mpv draw the whole screen in fullscreen mode.
* wayland: use mp_input_test_draggingAlexander Preisinger2013-10-201-3/+6
| | | | | | Instead of removing dragging we now test if it we should drag the window or not. Because if the OSC shows up we can not drag the window because that would cause mouse events that makes the OSC disappear.
* Revert "wayland: remove moving window by grabbing"Alexander Preisinger2013-10-201-0/+4
| | | | This reverts commit 3308bc2bc919cb8fadddad04e48b94d4e9324a34.
* Revert "wayland: remove outdated comment"Alexander Preisinger2013-10-201-0/+2
| | | | This reverts commit d75cfef49c271e43317666451f17c55e6747e564.
* wayland: remove outdated commentAlexander Preisinger2013-09-241-2/+0
|
* wayland: remove moving window by grabbingAlexander Preisinger2013-09-241-4/+0
| | | | | | Moving the window was convenient but generates a MOUSE_LEAVE event which it shouldn't. Now we remove it, because it is still possible to move the window in weston with MOD+BTN0.
* wayland/common: exit properly on fd errorsAlexander Preisinger2013-09-191-2/+6
| | | | | | | Before this commit there was just an error message, but the file descriptor was still open. Now we close the file descriptor and prevent it from calling endlessly. Also a CLOSE_WIN event is sent which closes the window eventually if the action of CLOSE_WIN is set to quit or quit_watch_later.
* gl_common: signal to GL backend whether we are probingwm42013-09-161-2/+4
| | | | | | | | | | | This is supposed to reduce the amount of useless error messages shown during initialization of vo_opengl. If multiple backends are compiled, usually only one of them will work. For example, on Linux both X and Wayland backends can be compiled, but usually either Wayland or X is running. Then, if Wayland is not running, but X is, trying to initialize the Wayland backend should not spam the terminal with error messages. Signed-off-by: Andreas Sinz <andreas.sinz@aon.at>
* wayland: change fs messages to dbgAlexander Preisinger2013-09-121-2/+2
| | | | These messages are only helpful when debugging.
* Revert "wayland: don't create our own log context"Alexander Preisinger2013-09-121-8/+9
| | | | | | | This reverts commit beab54506e61bc080880e827e351439f76542e68. Conflicts: video/out/wayland_common.c
* wayland/common: improved error messagesAlexander Preisinger2013-09-101-4/+8
| | | | | The previous error message were not very usefull. Also include a hint where to look for solutions.
* wayland: update license headersAlexander Preisinger2013-09-091-7/+5
|
* wayland: fix memory leaksAlexander Preisinger2013-08-261-2/+5
|
* wayland: don't create our own log contextAlexander Preisinger2013-08-261-10/+9
| | | | This was more problematic than useful ([vo/wayland/wayland])
* wayland: remove shm listener for the backendAlexander Preisinger2013-08-251-15/+0
| | | | | | The obtained information from the shm listener isn't used by anything and is also wrong now in wayland git master branch because of new shm formats which need a different way of saving the supported formats.
* wayland/egl: rework resizing (again)Alexander Preisinger2013-08-251-22/+61
| | | | | | | | | Moves a good chunk of the resizing code to wayland_common.c. This makes it possible to share it with future video drivers. It doesn't resizit it immediatly, it calcutlates the new position and size and then shedules a resizing event. This removes the ugly callback and void pointer from the wayland data structure.
* wayland: separate shm and cursor contextAlexander Preisinger2013-08-191-7/+13
| | | | | | The display, window, keyboard and cursor structures are now cleanly and logically separated. Also could prevent a future bug where no shm format is set when the cursor image is loaded (Never happened until now).
* wayland: add support for precise scrollingAle