FreeRDP
Loading...
Searching...
No Matches
RDPSessionToolbar.m
1//
2// RDPSessionToolbar.m
3// iFreeRDP
4//
5// Created by byungho on 6/21/26.
6//
7
8#import "RDPSessionToolbar.h"
9
10@implementation RDPSessionToolbar
11
12@synthesize passthroughView = _passthroughView;
13
14- (BOOL)isPointerEvent:(UIEvent *)event
15{
16 // allTouches is not yet populated when hit-testing a press, so rely on signals
17 // that are valid at that point: hover events and a pressed pointer button. Finger
18 // touches report an empty button mask.
19 return ([event type] == UIEventTypeHover) || ([event buttonMask] != 0);
20}
21
22- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
23{
24 // only direct screen touches operate the toolbar; pointer input (hover and
25 // mouse/trackpad clicks) is redirected to the remote session underneath
26 if (event != nil && _passthroughView != nil && [self isPointerEvent:event])
27 {
28 CGPoint converted = [self convertPoint:point toView:_passthroughView];
29 return [_passthroughView hitTest:converted withEvent:event];
30 }
31
32 return [super hitTest:point withEvent:event];
33}
34
35@end