Skip to content

Commit

Permalink
cocoa_events: remove this functionality
Browse files Browse the repository at this point in the history
This functionality looked smart but created problems with some kinds of
multi touch events. Moreover some events coming from the windows server – like
hovering a corner for window resize – didn't cause the player to wake up
immediately.

The "correct" non hacky way to implement async event polling with cocoa would
be having the vanilla cocoa event loop driving the player and setting up mpv's
terminal FDs as event sources for the cocoa event loop.

Fixes #20
  • Loading branch information
pigoz committed Feb 2, 2013
1 parent 6e4a454 commit 68fa3c4
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 185 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ SOURCES-$(LIBSMBCLIENT) += stream/stream_smb.c
SOURCES-$(MACOSX_FINDER) += osdep/macosx_finder_args.m
SOURCES-$(MACOSX_BUNDLE) += osdep/macosx_bundle.m
SOURCES-$(COCOA) += video/out/osx_common.m \
video/out/cocoa_common.m \
osdep/cocoa_events.m
video/out/cocoa_common.m
SOURCES-$(MNG) += demux/demux_mng.c
SOURCES-$(MPG123) += audio/decode/ad_mpg123.c

Expand Down
16 changes: 0 additions & 16 deletions core/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@

#include "ar.h"

#ifdef CONFIG_COCOA
#include "osdep/cocoa_events.h"
#endif

#define MP_MAX_KEY_DOWN 32

struct cmd_bind {
Expand Down Expand Up @@ -1505,11 +1501,7 @@ static void read_all_fd_events(struct input_ctx *ictx, int time)
static void read_all_events(struct input_ctx *ictx, int time)
{
getch2_poll();
#ifdef CONFIG_COCOA
cocoa_events_read_all_events(ictx, time);
#else
read_all_fd_events(ictx, time);
#endif
}

int mp_input_queue_cmd(struct input_ctx *ictx, mp_cmd_t *cmd)
Expand Down Expand Up @@ -1774,10 +1766,6 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf)

parse_config(ictx, true, bstr0(builtin_input_conf), "<default>");

#ifdef CONFIG_COCOA
cocoa_events_init(ictx, read_all_fd_events);
#endif

#ifndef __MINGW32__
long ret = pipe(ictx->wakeup_pipe);
for (int i = 0; i < 2 && ret >= 0; i++) {
Expand Down Expand Up @@ -1890,10 +1878,6 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf)

void mp_input_uninit(struct input_ctx *ictx)
{
#ifdef CONFIG_COCOA
cocoa_events_uninit();
#endif

if (!ictx)
return;

Expand Down
30 changes: 0 additions & 30 deletions osdep/cocoa_events.h

This file was deleted.

137 changes: 0 additions & 137 deletions osdep/cocoa_events.m

This file was deleted.

1 change: 1 addition & 0 deletions video/out/cocoa_common.m
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ static void disable_power_management(struct vo *vo)
int vo_cocoa_init(struct vo *vo)
{
vo->cocoa = vo_cocoa_init_state(vo);
vo->wakeup_period = 0.02;
_instances++;

NSApplicationLoad();
Expand Down

0 comments on commit 68fa3c4

Please sign in to comment.