}
disconnect:
+ [view setIs_connected:0];
freerdp_disconnect(instance);
if (settings->AsyncInput && inputThread)
- (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];
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);
}
}
+- (void) applicationWillBecomeActive:(NSNotification*)notification
+{
+ [mrdpView resume];
+}
+
+- (void) applicationWillResignActive:(NSNotification*)notification
+{
+ [mrdpView pause];
+}
+
- (void) applicationWillTerminate:(NSNotification*)notification
{
NSLog(@"Stopping...\n");