Skip to content

Commit

Permalink
move the swt hack to application.vala
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed Jun 20, 2010
1 parent da4e2df commit 14f8673
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
12 changes: 10 additions & 2 deletions applet/application.vala
Expand Up @@ -112,8 +112,16 @@ public class Application{
Application app = new Application();
app.key = key;
app.not_in_menu = true;
app.readable_name = wapp.get_name();

string name = wapp.get_name();

/* workaround to java/swt based apps due to a bug in swt */
if(name == "." || name == "<unknown>") {
unowned List<Wnck.Window> windows = wapp.get_windows();
if(windows != null)
name = windows.data.get_name();
}
app.readable_name = name;

app.exec_path = null;
/* NOTE: get_icon_name is not implement in wnck.
* Therefore we set icon_pixbuf, which
Expand Down
30 changes: 14 additions & 16 deletions applet/switcher.vala
Expand Up @@ -288,24 +288,22 @@ extern int system(string arg);
if (!guess_dock_is_around())
set_iconify_destination(_current_window);

_label = _("UNKNOWN-REPORT-A-BUG!");
Application app = Application.lookup_from_wnck(current_window.get_application());

Wnck.WindowType wt = current_window.get_window_type();
if (wt==Wnck.WindowType.DOCK)
_label = "";
else {
if(app != null) {
_label = (current_window.get_window_type()==Wnck.WindowType.DESKTOP) ?
_("Desktop") : app.readable_name;

/* workaround to java/swt based apps due to a bug in swt */
if ((_label==".") || (_label=="<unknown>")) {
_label = current_window.get_name();
}

} else {
_label = "app unknown shouldn't see this";
}
switch(current_window.get_window_type()) {
case Wnck.WindowType.DESKTOP :
_label = _("Desktop");
break;
case Wnck.WindowType.DOCK :
/* We are in good hands if a dock is activated */
/* FIXME: probably should simply not activate a dock */
_label = "";
break;
default:
if(app != null)
_label = app.readable_name;
break;
}

string s = MENU_TEMPLATE;
Expand Down

0 comments on commit 14f8673

Please sign in to comment.