#include <vlc_common.h>
#include <vlc_vout_window.h>
+#include <vlc_modules.h>
#include "inhibit.h"
#include <libvlc.h>
const char *type;
switch (cfg->type) {
+#ifdef WIN32
case VOUT_WINDOW_TYPE_HWND:
type = "vout window hwnd";
+ window->handle.hwnd = NULL;
break;
+#endif
+#ifdef __APPLE__
+ case VOUT_WINDOW_TYPE_NSOBJECT:
+ type = "vout window nsobject";
+ window->handle.nsobject = NULL;
+ break;
+#endif
case VOUT_WINDOW_TYPE_XID:
type = "vout window xid";
+ window->handle.xid = 0;
+ window->display.x11 = NULL;
break;
default:
assert(0);
w->module = module_need(window, type, module, module && *module != '\0');
if (!w->module) {
- vlc_object_detach(window);
vlc_object_release(window);
return NULL;
}
/* Hook for screensaver inhibition */
- if (cfg->type == VOUT_WINDOW_TYPE_XID) {
+ if ( var_InheritBool( obj, "disable-screensaver" ) && cfg->type == VOUT_WINDOW_TYPE_XID) {
w->inhibit = vlc_inhibit_Create (VLC_OBJECT (window),
window->handle.xid);
if (w->inhibit != NULL)
vlc_inhibit_Set (w->inhibit, true);
/* FIXME: ^ wait for vout activation, pause */
}
+ else
+ w->inhibit = NULL;
return window;
}
window_t *w = (window_t *)window;
if (w->inhibit)
vlc_inhibit_Destroy (w->inhibit);
- vlc_object_detach(window);
module_unneed(window, w->module);