mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
Fixed #5234: Added timer invalidate on application willresignactive
This commit is contained in:
parent
d03c348595
commit
2d4f53ed41
@ -233,6 +233,7 @@ DWORD WINAPI mac_client_thread(void* param)
|
||||
}
|
||||
|
||||
disconnect:
|
||||
[view setIs_connected:0];
|
||||
freerdp_disconnect(instance);
|
||||
|
||||
if (settings->AsyncInput && inputThread)
|
||||
@ -794,6 +795,9 @@ DWORD fixKeyCode(DWORD keyCode, unichar keyChar, enum APPLE_KEYBOARD_TYPE type)
|
||||
|
||||
- (void)resume
|
||||
{
|
||||
if (!self.is_connected)
|
||||
return;
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^
|
||||
{
|
||||
self->pasteboard_timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(onPasteboardTimerFired:) userInfo:nil repeats:YES];
|
||||
@ -930,9 +934,16 @@ BOOL mac_post_connect(freerdp* instance)
|
||||
|
||||
void mac_post_disconnect(freerdp* instance)
|
||||
{
|
||||
mfContext* mfc;
|
||||
MRDPView* view;
|
||||
if (!instance || !instance->context)
|
||||
return;
|
||||
|
||||
mfc = (mfContext*) instance->context;
|
||||
view = (MRDPView*) mfc->view;
|
||||
|
||||
[view pause];
|
||||
|
||||
PubSub_UnsubscribeChannelConnected(instance->context->pubSub, mac_OnChannelConnectedEventHandler);
|
||||
PubSub_UnsubscribeChannelDisconnected(instance->context->pubSub,
|
||||
mac_OnChannelDisconnectedEventHandler);
|
||||
|
@ -82,6 +82,16 @@ void mac_set_view_size(rdpContext* context, MRDPView* view);
|
||||
}
|
||||
}
|
||||
|
||||
- (void) applicationWillBecomeActive:(NSNotification*)notification
|
||||
{
|
||||
[mrdpView resume];
|
||||
}
|
||||
|
||||
- (void) applicationWillResignActive:(NSNotification*)notification
|
||||
{
|
||||
[mrdpView pause];
|
||||
}
|
||||
|
||||
- (void) applicationWillTerminate:(NSNotification*)notification
|
||||
{
|
||||
NSLog(@"Stopping...\n");
|
||||
|
Loading…
Reference in New Issue
Block a user