summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
Commit message (Collapse)AuthorAgeFilesLines
* 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 scrollingAlexander Preisinger2013-08-071-2/+14
| | | | | | | | The default value for a standard mouse is 10.0. Because we don't want to multiply the value in the input config file we scale it down to 1.0. Hopefully this should work for more precise mousewheels or touchpad, but I don't have access to such hardware.
* core: move contents to mpvcore (2/2)Stefano Pigozzi2013-08-061-5/+5
| | | | Followup commit. Fixes all the files references.
* wayland: switch to the new mp_msg apiAlexander Preisinger2013-07-311-8/+15
|
* Remove subopt-helperwm42013-07-221-2/+0
| | | | Finally not used by anything anymore. Farewell.
* wayland: use a unified struct for the stateAlexander Preisinger2013-07-181-222/+214
| | | | | | | | | | This commit removes the pointer to the single different structures for input and window and puts them as anonymous structures inside the wayland_state structure. This has the disadvantage of passing the substructure to the listeners, but the advantage is that we don't have to allocate them and check for NULL pointers. This makes it more reliable and easier to follow.
* wayland: don't resize in gl_wayland.cAlexander Preisinger2013-07-181-2/+0
| | | | | | The vo_wayland_fullscreen handles resizing for the video, because the video could still be in fullscreen mode and resizing it in gl_wayland could make it grow or shrink.
* video: remove fullscreen flags chaoswm42013-07-181-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a MPOpts fullscreen field, a mp_vo_opts.fs field, and VOFLAG_FULLSCREEN. Remove all these and introduce a mp_vo_opts.fullscreen flag instead. When VOs receive VOCTRL_FULLSCREEN, they are supposed to set the current fullscreen mode to the state in mp_vo_opts.fullscreen. They also should do this implicitly on config(). VOs which are capable of doing so can update the mp_vo_opts.fullscreen if the actual fullscreen mode changes (e.g. if the user uses the window manager controls). If fullscreen mode switching fails, they can also set mp_vo_opts.fullscreen to the actual state. Note that the X11 backend does almost none of this, and it has a private fs flag to store the fullscreen flag, instead of getting it from the WM. (Possibly because it has to deal with broken WMs.) The fullscreen option has to be checked on config() to deal with the -fs option, especially with something like: mpv --fs file1.mkv --{ --no-fs file2.mkv --} (It should start in fullscreen mode, but go to windowed mode when playing file2.mkv.) Wayland changes by: Alexander Preisinger <alexander.preisinger@gmail.com> Cocoa changes by: Stefano Pigozzi <stefano.pigozzi@gmail.com>
* wayland: early aspect calculation in vo_configAlexander Preisinger2013-07-161-0/+2
| | | | | | | | | | | | Calculate the aspect ratio in vo_config, when we get the window size and in the inside the resize function we calculate the aspect ratio of the output in order to determine if we have to change the height or the width of the video. If the ratio of the output is bigger than the ratio of the video then we have to set the width accordingly and if the ratio is smaller we change the size. But only if no resize edges are passed, because this indicates that we want to change the windows state instead of just a simple resize and the video should not grow bigger than the requested size.
* wayland: use default fullscreen methodAlexander Preisinger2013-07-161-1/+1
| | | | | I misunderstood how the different methods work and if we set the size accordingly to the wayland configure event then METHOD_DEFAULT is what we want.
* wayland: remove mp_fifo headerAlexander Preisinger2013-07-031-1/+0
|
* wayland: fix typoAlexander Preisinger2013-07-031-1/+1
|
* wayland: remove mp_fifoAlexander Preisinger2013-07-021-7/+7
|
* wayland: implement MOUSE_LEAVEAlexander Preisinger2013-07-021-0/+2
|
* input: require VOs to send key up events, redo input key lookupwm42013-07-021-3/+4
| | | | | | | | | | | | | | Making key up events implicit was sort-of a nice idea, but it's too tricky and unreliable and makes the key lookup code (interpret_keys()) hard to reason about. See e.g. previous commit for subtle bugs and issues this caused. Make key-up events explicit instead. Add key up events to all VOs. Any time MP_KEY_STATE_DOWN is used, the matching key up event must use MP_KEY_STATE_UP. Rewrite the key lookup code. It should be simpler and more robust now. (Even though the LOC increases, because the new code is less "compact".)
* wayland: use VOCTRL_UPDATE_WINDOW_TTILEAlexander Preisinger2013-06-161-1/+3
|
* wayland: use VOCTRL_SET_CURSOR_VISIBILITYAlexander Preisinger2013-05-261-33/+23
|
* wayland: introduce vo_wayland_configAlexander Preisinger2013-05-261-13/+21
| | | | | This removes the need for exposing vo_wayland_fullscreen and other functions also this will be usefull for other vos in the future.
* video/out: introduce vo_control for gl_common based VOswm42013-05-261-0/+23
| | | | | | | | | | | | | | | | Instead of having separate callbacks for each backend-handled feature (like MPGLContext.fullscreen, MPGLContext.border, etc.), pass the VOCTRL responsible for this directly to the backend. This allows removing a bunch of callbacks, that currently must be set even for optional/lesser features (like VOCTRL_BORDER). This requires changes to all VOs using gl_common, as well as all backends that support gl_common. Also introduce VOCTRL_CHECK_EVENTS. vo.check_events is now optional. VO backends can use VOCTRL_CHECK_EVENTS instead to implementing check_events. This has the advantage that the event handling code in VOs doesn't have to be duplicated if vo_control() is used.
* wayland: reworked resizingAlexander Preisinger2013-05-071-15/+21
| | | | | | | | | | This fixes 2 bugs: * Resizing very fast breaks the aspect of the window and the width and height don't match with the video anymore * Pressing 'f' for fullscreen very fast can overwrite the backup variables for the previous width and height. Also includes a better aspect calculation with fluid resizing.
* wayland: fix wrong poll comment, check for errorsAlexander Preisinger2013-05-021-2/+4
| | | | | | | | We only print an error message when POLLERR or POLLHUP occurrs, as the something did go horribly wrong and the server will either deal with it or crash. Also add POLLOUT to the events.
* wayland: avoid iterating over all outputsAlexander Preisinger2013-05-021-15/+18
| | | | | If we use the output itself as user data we don't have to iterate over all outputs when the handle_mode event comes.
* wayland: remove unused stuffAlexander Preisinger2013-05-021-12/+0
|
* wayland: use new function xkb_keymap_from_bufferAlexander Preisinger2013-05-021-9/+5
| | | | | | Bump xkbcommon version and use the new xkb_keymap_from_buffer. This is more secure, because the from_string expects a 0 terminated string, but this cannot be guaranteed with mmap.
* wayland: remove input modifier variableAlexander Preisinger2013-05-011-12/+0
| | | | This variable was never used anywhere.
* wayland: use GetTimerMS for hiding mouse cursorAlexander Preisinger2013-05-011-148/+36
| | | | | | This commit remove a lot of linux specific code, like epoll. It also reduces the complexity of the code. Instead of epoll we use poll which makes the wayland backend more portable to other platforms.
* wayland: use mpv internal key auto-repeat handlingAlexander Preisinger2013-05-011-53/+5
| | | | | | This removes a good chunk of code trying to recreate key repeat. Because the wayland protocol and xkbcommon don't have an interface for auto-repeating pressed keys.
* wayland: fully support cursor autohide optionsAlexander Preisinger2013-03-231-15/+15
| | | | I missed the special cases in the previous commits.
* wayland: use the cursor_autohide_delay optionAlexander Preisinger2013-03-111-6/+9
| | | | | In the previous implemention the backend always assumed 1 second instead of honoring the cursor_autohide_delay option
* wayland: move window by grabing itAlexander Preisinger2013-03-111-0/+8
| | | | | Because the are no server-side-decorations in the available wayland compositors use grabbing the surface to move it.
* vo: Separate vo options from MPOptsAlexander Preisinger2013-03-041-12/+12
| | | | | | | Separate the video output options from the big MPOpts structure and also only pass the new mp_vo_opts structure to the vo backend. Move video_driver_list into mp_vo_opts
* vo: remove and cleanup globalsAlexander Preisinger2013-03-041-14/+12
| | | | | | | | Removes almost every global variabel in vo.h and puts them in a special struct in MPOpts for video output related options. Also we completly remove the options/globals pts and refresh rate because they were unused.
* x11_common: use private variables for window statewm42013-03-031-5/+1
| | | | | | | | | | | | | | | | Store the window state (position and size) in vo_x11_state, instead of in vo->dx/dy/dwidth/dheight. The VO variables are overwritten by vo.c on every vo_config() call, which is extremely not helpful. Now vo->dx/dy are mostly unused (except for passing the position forced by the --geometry option), and vo->dwidth/dheight are set for the VO, and otherwise read for resize detection only. In the long term, the way vo_config() handles the --geometry option should be changed, and vo->dx/dy should be removed. Remove some useless stuff: VO_EVENT_MOVE and VO_EVENT_KEYPRESS were generated, but unused. Wayland changes by Alexander Preisinger.
* wayland: add wayland supportAlexander Preisinger2013-02-281-0/+1036
All wayland only specific routines are placed in wayland_common. This makes it easier to write other video outputs. The EGL specific parts, as well as opengl context creation, are in gl_common. This backend works for: * opengl-old * opengl * opengl-hq To use it just specify the opengl backend --vo=opengl:backend=wayland or disable the x11 build. Don't forget to set EGL_PLATFORM to wayland. Co-Author: Scott Moreau (Sorry I lost the old commit history due to the file structure changes)