1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-26 14:53:26 +01:00

Prevented user from manually closing video windows

This commit is contained in:
cnhenry 2015-08-13 23:51:39 -05:00
parent b67792f9f2
commit 929fca3de1
3 changed files with 10 additions and 5 deletions

View File

@ -295,6 +295,7 @@ void callstate_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_
callback_call_ended(friend_number); callback_call_ended(friend_number);
#ifdef VIDEO #ifdef VIDEO
callback_recv_video_end(friend_number);
callback_video_end(friend_number); callback_video_end(friend_number);
#endif /* VIDEO */ #endif /* VIDEO */

View File

@ -120,10 +120,7 @@ void write_video_device_callback(uint32_t friend_number, uint16_t width, uint16_
int32_t ystride, int32_t ustride, int32_t vstride, int32_t ystride, int32_t ustride, int32_t vstride,
void *user_data) void *user_data)
{ {
if ( write_video_out(width, height, y, u, v, ystride, ustride, vstride, user_data) == vde_DeviceNotActive ) { write_video_out(width, height, y, u, v, ystride, ustride, vstride, user_data);
//callback_recv_video_starting(friend_number);
return;
}
} }
int start_video_transmission(ToxWindow *self, ToxAV *av, Call *call) int start_video_transmission(ToxWindow *self, ToxAV *av, Call *call)

View File

@ -462,6 +462,10 @@ VideoDeviceError open_video_device(VideoDeviceType type, int32_t selection, uint
return vde_FailedStart; return vde_FailedStart;
} }
/* Disable user from manually closing the X11 window */
Atom wm_delete_window = XInternAtom(device->x_display, "WM_DELETE_WINDOW", false);
XSetWMProtocols(device->x_display, device->x_window, &wm_delete_window, 1);
XMapWindow(device->x_display, device->x_window); XMapWindow(device->x_display, device->x_window);
XClearWindow(device->x_display, device->x_window); XClearWindow(device->x_display, device->x_window);
XMapRaised(device->x_display, device->x_window); XMapRaised(device->x_display, device->x_window);
@ -497,6 +501,10 @@ VideoDeviceError open_video_device(VideoDeviceType type, int32_t selection, uint
return vde_FailedStart; return vde_FailedStart;
} }
/* Disable user from manually closing the X11 window */
Atom wm_delete_window = XInternAtom(device->x_display, "WM_DELETE_WINDOW", false);
XSetWMProtocols(device->x_display, device->x_window, &wm_delete_window, 1);
XMapWindow(device->x_display, device->x_window); XMapWindow(device->x_display, device->x_window);
XClearWindow(device->x_display, device->x_window); XClearWindow(device->x_display, device->x_window);
XMapRaised(device->x_display, device->x_window); XMapRaised(device->x_display, device->x_window);
@ -694,7 +702,6 @@ VideoDeviceError close_video_device(VideoDeviceType type, uint32_t device_idx)
} }
} }
close(device->fd); close(device->fd);
vpx_img_free(&device->input);
XDestroyWindow(device->x_display, device->x_window); XDestroyWindow(device->x_display, device->x_window);
XFlush(device->x_display); XFlush(device->x_display);
XCloseDisplay(device->x_display); XCloseDisplay(device->x_display);