Skip to content

Commit

Permalink
Now ignoring synthesized mouse events in order to properly support to…
Browse files Browse the repository at this point in the history
…uch screen UIs. Editing calendar entries via touch is basically disabled for now on touch screens.
  • Loading branch information
dlemmermann committed Jan 19, 2023
1 parent d0286c6 commit d764816
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ private boolean initDragModeAndHandle(MouseEvent evt) {
dragMode = null;
handle = null;

/*
* On touch screen devices we can not edit entries.
*/
if (evt.isSynthesized()) {
return false;
}

if (!(evt.getTarget() instanceof EntryViewBase)) {
return false;
}
Expand Down Expand Up @@ -347,13 +354,19 @@ private void mouseDragged(MouseEvent evt) {
return;
}

if (evt.isSynthesized()) {
return;
}

switch (operation) {
case NONE:
break;
case EDIT_ENTRY:
Calendar calendar = entry.getCalendar();
if (!calendar.isReadOnly()) {
mouseDraggedEditEntry(evt);
if (entry != null) {
Calendar calendar = entry.getCalendar();
if (!calendar.isReadOnly()) {
mouseDraggedEditEntry(evt);
}
}
break;
case EDIT_AVAILABILITY:
Expand Down Expand Up @@ -508,7 +521,7 @@ private void mouseReleasedEditEntry() {
//
// sourceEntry.setInterval(sourceInterval);
// } else {
entry.setInterval(newInterval);
entry.setInterval(newInterval);
// }

if (view.isShowDetailsUponEntryCreation() && operation.equals(Operation.CREATE_ENTRY)) {
Expand Down

0 comments on commit d764816

Please sign in to comment.