1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Linux - Fixed a couple small issues

This commit is contained in:
Diogo Trindade 2022-08-27 21:40:02 +01:00 committed by RobertBeekman
parent 04ef4f0173
commit ddfdbee340
3 changed files with 20 additions and 3 deletions

View File

@ -32,13 +32,13 @@ internal class ProcessMonitorService : IProcessMonitorService
foreach (Process startedProcess in newProcesses.Except(_lastScannedProcesses, _comparer))
{
ProcessStarted?.Invoke(this, new ProcessEventArgs(startedProcess));
_logger.Verbose("Started Process: {startedProcess}", startedProcess.ProcessName);
//_logger.Verbose("Started Process: {startedProcess}", startedProcess.ProcessName);
}
foreach (Process stoppedProcess in _lastScannedProcesses.Except(newProcesses, _comparer))
{
ProcessStopped?.Invoke(this, new ProcessEventArgs(stoppedProcess));
_logger.Verbose("Stopped Process: {stoppedProcess}", stoppedProcess.ProcessName);
//_logger.Verbose("Stopped Process: {stoppedProcess}", stoppedProcess.ProcessName);
}
_lastScannedProcesses = newProcesses;

View File

@ -112,7 +112,18 @@ public class LinuxInputProvider : InputProvider
switch (args.Type)
{
case LinuxInputEventType.KEY:
bool isDown = args.Value != 0;
var key = (LinuxKeyboardKeyCodes)args.Code;
if (key == LinuxKeyboardKeyCodes.BTN_TOUCH ||
(key >= LinuxKeyboardKeyCodes.BTN_TOOL_PEN && key <= LinuxKeyboardKeyCodes.BTN_TOOL_QUADTAP))
{
//trackpad input, ignore.
return;
}
//0 - up
//1 - down
//2 - repeat input
bool isDown = args.Value == 1;
MouseButton button = InputUtilities.MouseButtonFromButtonCode((LinuxKeyboardKeyCodes) args.Code);
//_logger.Verbose($"Mouse Button: {(LinuxKeyboardKeyCodes)args.Code} | Down: {isDown}");

View File

@ -287,6 +287,12 @@ public abstract class TreeItemViewModel : ActivatableViewModelBase
}
string[] formats = await Application.Current.Clipboard.GetFormatsAsync();
//diogotr7: This can be null on Linux sometimes. I'm not sure why.
if (formats == null)
{
CanPaste = false;
return;
}
CanPaste = formats.Contains(ProfileElementExtensions.ClipboardDataFormat);
}