示例#1
0
文件: Pointer.cs 项目: guytp/ztk
        private void OnButtonListener(IntPtr data, IntPtr pointerHandle, uint serial, uint time, WaylandMouseButton button, uint state)
        {
            if (_currentSurface == IntPtr.Zero)
            {
                return;
            }
            Control      window = GetControlForSurface(_currentSurface);
            SeatInstance seat   = App.CurrentApplication.Registry.Seat.Seats.First(s => s.Pointer == this);

            window.TriggerWaylandPointerButton(new WaylandPointerButtonEventArgs(this, seat, serial, button, state == 1, _currentSurfaceX, _currentSurfaceY));
        }
示例#2
0
        private void OnSeatCapabilities(IntPtr data, IntPtr seatHandle, SeatCapability seatCapabilities)
        {
            // Get a handle to, or add, this seat
            SeatInstance seat = Seats.FirstOrDefault(s => s.Handle == seatHandle);

            if (seat == null)
            {
                seat = new SeatInstance(seatHandle);
                Seats.Add(seat);
            }

            seat.UpdateCapabilities(seatCapabilities);
        }
示例#3
0
        private void OnSeatName(IntPtr data, IntPtr seatHandle, string name)
        {
            // Get a handle to, or add, this seat
            SeatInstance seat = Seats.FirstOrDefault(s => s.Handle == seatHandle);

            if (seat == null)
            {
                seat = new SeatInstance(seatHandle);
                Seats.Add(seat);
            }

            // Update the name
            seat.Name = name;
        }