Skip to content

Commit

Permalink
only invoke later if not already on EDT, fixes selection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
abika committed Mar 8, 2015
1 parent 0fc7453 commit 1d645cd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/org/kontalk/view/ThreadListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ KonThread getSelectedThread() {

@Override
public void update(Observable o, Object arg) {
if (SwingUtilities.isEventDispatchThread()) {
this.updateOnEDT();
return;
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -246,6 +250,10 @@ String getTooltipText() {

@Override
public void update(Observable o, Object arg) {
if (SwingUtilities.isEventDispatchThread()) {
this.updateOnEDT();
return;
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Expand Down
8 changes: 8 additions & 0 deletions src/org/kontalk/view/ThreadView.java
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ private void check(MouseEvent e) {

@Override
public void update(Observable o, Object arg) {
if (SwingUtilities.isEventDispatchThread()) {
this.updateOnEDT();
return;
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -508,6 +512,10 @@ private String toPrettyString() {

@Override
public void update(Observable o, Object arg) {
if (SwingUtilities.isEventDispatchThread()) {
this.updateOnEDT();
return;
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Expand Down
4 changes: 4 additions & 0 deletions src/org/kontalk/view/UserListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ public void mouseExited(MouseEvent e) {

@Override
public void update(Observable o, Object arg) {
if (SwingUtilities.isEventDispatchThread()) {
this.updateOnEDT();
return;
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Expand Down
4 changes: 4 additions & 0 deletions src/org/kontalk/view/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,10 @@ void showConfig() {

@Override
public void update(Observable o, final Object arg) {
if (SwingUtilities.isEventDispatchThread()) {
this.updateOnEDT(arg);
return;
}
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
Expand Down

0 comments on commit 1d645cd

Please sign in to comment.