mirror of
https://github.com/Tha14/toxic.git
synced 2024-12-23 10:53:26 +01:00
Prevented user from manually closing video windows
This commit is contained in:
parent
b67792f9f2
commit
929fca3de1
@ -295,6 +295,7 @@ void callstate_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_
|
||||
callback_call_ended(friend_number);
|
||||
|
||||
#ifdef VIDEO
|
||||
callback_recv_video_end(friend_number);
|
||||
callback_video_end(friend_number);
|
||||
#endif /* VIDEO */
|
||||
|
||||
|
@ -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,
|
||||
void *user_data)
|
||||
{
|
||||
if ( write_video_out(width, height, y, u, v, ystride, ustride, vstride, user_data) == vde_DeviceNotActive ) {
|
||||
//callback_recv_video_starting(friend_number);
|
||||
return;
|
||||
}
|
||||
write_video_out(width, height, y, u, v, ystride, ustride, vstride, user_data);
|
||||
}
|
||||
|
||||
int start_video_transmission(ToxWindow *self, ToxAV *av, Call *call)
|
||||
|
@ -462,6 +462,10 @@ VideoDeviceError open_video_device(VideoDeviceType type, int32_t selection, uint
|
||||
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);
|
||||
XClearWindow(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;
|
||||
}
|
||||
|
||||
/* 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);
|
||||
XClearWindow(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);
|
||||
vpx_img_free(&device->input);
|
||||
XDestroyWindow(device->x_display, device->x_window);
|
||||
XFlush(device->x_display);
|
||||
XCloseDisplay(device->x_display);
|
||||
|
Loading…
Reference in New Issue
Block a user