Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error message on crash during initialization #122

Open
hannson opened this issue Apr 8, 2015 · 7 comments
Open

Misleading error message on crash during initialization #122

hannson opened this issue Apr 8, 2015 · 7 comments

Comments

@hannson
Copy link

hannson commented Apr 8, 2015

Steps to reproduce:

  • Have two monitors
  • Use XFCE with a single workspace defined (a reasonable config)
  • Build Wingo with make
  • New config via wingo --write-config
  • Run wingo --replace

Errors in console:

WINGO WARNING: state.go:74: Could not add workspace : workspaces must have a name of length at least one.
WINGO WARNING: state.go:74: Could not add workspace : workspaces must have a name of length at least one.
WINGO ERROR: heads.go:42: There must be at least 2 workspaces (one for each head).

When you read the default config you can clearly see the 6 workspaces:

~/.config/wingo/options.wini

[Options]
# The list of workspaces to set upon startup. Workspaces can be added or
# removed while Wingo is running.
workspaces := 1 2 3 4 browser mail

Yet, it does not work. Apparently there's a hidden check for EWMH that overrides the config file.

In state.go:

// If _NET_DESKTOP_NAMES is set, let's use workspaces from that instead.
if names, _ := ewmh.DesktopNamesGet(X); len(names) > 0 {
    for _, wrkName := range names {
        if err := AddWorkspace(wrkName); err != nil {
            logger.Warning.Printf("Could not add workspace %s: %s",
                wrkName, err)
        }
    }
} else {
    for _, wrkName := range Config.Workspaces {
        if err := AddWorkspace(wrkName); err != nil {
            logger.Error.Fatalf("Could not initialize workspaces: %s", err)
        }
    }
}
Heads.Initialize(Clients)

I think this could be handled more gracefully. Perhaps by doing something equivalent to this:

// If _NET_DESKTOP_NAMES is set, let's use workspaces from that instead.
if names, _ := ewmh.DesktopNamesGet(X); len(names) >= heads.NumHeads() {

So that it reverts back to options.wini if DesktopNamesGet is insufficient (even if it is present). Having said that I believe this behavior should be properly documented (I suggest putting it in options.wini in the comment above the workspaces variable) and actually logged as well in some verbose log level.

Thoughts?

@BurntSushi
Copy link
Owner

Yeah, I think that is a reasonable change in behavior. Nice find!

Do you want to submit a PR? Otherwise, I can do it.

@hannson
Copy link
Author

hannson commented Apr 9, 2015

You can do it if you don't mind. I haven't forked the project yet.

@averrin
Copy link

averrin commented Sep 7, 2016

So, and how i can run wingo?

❯ wingo --replace
WINGO ERROR: heads.go:42: There must be at least 2 workspaces (one for each head).
❯ head ~/.config/wingo/options.wini                                                                                                                                                             user@PC-001-00480
# These are some global configuration options for Wingo. It may not look like
# there's a lot here, but that's because a lot of the configuration is done
# with your key/mouse bindings, and your theme settings.

[Options]
# The list of workspaces to set upon startup. Workspaces can be added or
# removed while Wingo is running.
workspaces := 1 2

@BurntSushi
Copy link
Owner

I don't think wingo modifies workspace list when replacing. Create more workspaces in your existing window manger.

@averrin
Copy link

averrin commented Sep 7, 2016

I use awesome. Ok, i add second tag, but:

❯ wingo --replace                                                                                                                                                                               user@PC-001-00480
WINGO WARNING: state.go:72: Could not add workspace #: a workspace with name '#' already exists.
WINGO WARNING: state.go:72: Could not add workspace #2: a workspace with name '#2' already exists.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-s': Got a bad access error when trying to bind 'Mod1-s'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-right': Got a bad access error when trying to bind 'Mod4-Shift-right'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-w': Got a bad access error when trying to bind 'Mod1-w'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-w': Got a bad access error when trying to bind 'Mod1-w'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-F2': Got a bad access error when trying to bind 'Mod1-F2'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-left': Got a bad access error when trying to bind 'Mod4-Shift-left'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-a': Got a bad access error when trying to bind 'Mod1-a'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-h': Got a bad access error when trying to bind 'Mod1-h'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-left': Got a bad access error when trying to bind 'Mod4-left'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-n': Got a bad access error when trying to bind 'Mod1-n'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-k': Got a bad access error when trying to bind 'Mod1-k'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-h': Got a bad access error when trying to bind 'Mod4-Shift-h'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-right': Got a bad access error when trying to bind 'Mod4-right'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-e': Got a bad access error when trying to bind 'Mod1-e'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-e': Got a bad access error when trying to bind 'Mod1-e'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-l': Got a bad access error when trying to bind 'Mod4-Shift-l'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:51: Could not bind 'Mod1-Tab': Got a bad access error when trying to bind 'Mod1-Tab'. This usually means another client has already grabbed this keybinding.
WINGO ERROR: root.go:34: Could not listen to Root window events: BadAccess {NiceName: Access, Sequence: 693, BadValue: 216, MinorOpcode: 0, MajorOpcode: 2}

It means "--replace" is not my case?

@BurntSushi
Copy link
Owner

It means your existing window manager isn't quitting when Wingo asks it too.

On Sep 7, 2016 5:44 AM, "Averrin" notifications@github.com wrote:

I use awesome. Ok, i add second tag, but:

❯ wingo --replace user@PC-001-00480
WINGO WARNING: state.go:72: Could not add workspace #: a workspace with name '#' already exists.
WINGO WARNING: state.go:72: Could not add workspace #2: a workspace with name '#2' already exists.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-s': Got a bad access error when trying to bind 'Mod1-s'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-right': Got a bad access error when trying to bind 'Mod4-Shift-right'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-w': Got a bad access error when trying to bind 'Mod1-w'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-w': Got a bad access error when trying to bind 'Mod1-w'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-F2': Got a bad access error when trying to bind 'Mod1-F2'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-left': Got a bad access error when trying to bind 'Mod4-Shift-left'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-a': Got a bad access error when trying to bind 'Mod1-a'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-h': Got a bad access error when trying to bind 'Mod1-h'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-left': Got a bad access error when trying to bind 'Mod4-left'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-n': Got a bad access error when trying to bind 'Mod1-n'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-k': Got a bad access error when trying to bind 'Mod1-k'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-h': Got a bad access error when trying to bind 'Mod4-Shift-h'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-right': Got a bad access error when trying to bind 'Mod4-right'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-e': Got a bad access error when trying to bind 'Mod1-e'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod1-e': Got a bad access error when trying to bind 'Mod1-e'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:77: Could not bind 'Mod4-Shift-l': Got a bad access error when trying to bind 'Mod4-Shift-l'. This usually means another client has already grabbed this keybinding.
WINGO WARNING: bindings_key.go:51: Could not bind 'Mod1-Tab': Got a bad access error when trying to bind 'Mod1-Tab'. This usually means another client has already grabbed this keybinding.
WINGO ERROR: root.go:34: Could not listen to Root window events: BadAccess {NiceName: Access, Sequence: 693, BadValue: 216, MinorOpcode: 0, MajorOpcode: 2}

It means "--replace" is not my case?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#122 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAb34nfxFTyNrWVfJG1vPRVjNVGPvnK7ks5qnodrgaJpZM4D8Z_B
.

@averrin
Copy link

averrin commented Sep 7, 2016

Ok,
killall awesome; wingo
helps, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants