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

[Bug] Object reference not set to an instance of an object #304

Open
Dimfred opened this issue Apr 22, 2023 · 0 comments
Open

[Bug] Object reference not set to an instance of an object #304

Dimfred opened this issue Apr 22, 2023 · 0 comments

Comments

@Dimfred
Copy link

Dimfred commented Apr 22, 2023

Hey first of all thank you so so much, I love glaze it has everything I love and more, config format is clean af! I can finally work with windows without starting to cry :D

I am basically leaving this here for later / for someone with the same problem. My problem could be solved by changing the order of my commands, but I don't think this is intended behavior.

So the setup:
It happens when I switch from an empty workspace to another, after that I enable a mode. Worth to note that the "P" binding is already called from another mode.

So I have:

  • Windows => enter base mode
  • g => enter go mode
  • p => go to workspace p and fall back to base mode

Binding looks like this:

      - binding: "P"
        commands:
          - "focus workspace 1"
          - "binding mode base"

The workspace switches focus, but afterwards an exception pops (see log below).

The issue is not there when, I first toggle the mode and then the focus:

      - binding: "P"
        commands:
          - "binding mode base"
          - "focus workspace 1"

Log:

22-Apr-23 21:10:40
System.NullReferenceException: Object reference not set to an instance of an object.
   at GlazeWM.Domain.UserConfigs.CommandHandlers.RegisterKeybindingsHandler.<>c__DisplayClass6_0.<Handle>b__2() in \\wsl.localhost\Arch\home\dimfred\workspaces\GlazeWM\GlazeWM.Domain\UserConfigs\CommandHandlers\RegisterKeybindingsHandler.cs:line 63
Command history: HandleFatalExceptionCommand, SetFocusedDescendantCommand, CenterCursorOnContainerCommand, SetActiveWindowBorderCommand, DetachContainerCommand, DeactivateWorkspaceCommand, SetNativeFocusCommand, RedrawContainersCommand, SetFocusedDescendantCommand, FocusWorkspaceCommand, RegisterKeybindingsCommand, SetBindingModeCommand, RegisterKeybindingsCommand, SetBindingModeCommand, RegisterKeybindingsCommand 
State dump:
{
   "X":0,
   "Y":0,
   "Width":0,
   "Height":0,
   "__type":"RootContainer",
   "FocusIndex":0,
   "Children":[
      {
         "X":-1920,
         "Y":0,
         "Width":1920,
         "Height":1080,
         "__type":"Monitor",
         "FocusIndex":2,
         "DeviceName":"\\\\.\\DISPLAY1",
         "Children":[
            {
               "X":-1920,
               "Y":0,
               "Width":1920,
               "Height":1045,
               "__type":"Workspace",
               "FocusIndex":1,
               "Name":"12",
               "Children":[
                  {
                     "X":-1180,
                     "Y":398,
                     "Width":440,
                     "Height":248,
                     "__type":"FloatingWindow",
                     "FocusIndex":0,
                     "Handle":67128,
                     "FloatingPlacement":{
                        "Left":-1180,
                        "Top":398,
                        "Right":-740,
                        "Bottom":646,
                        "X":-1180,
                        "Y":398,
                        "Width":440,
                        "Height":248
                     },
                     "BorderDelta":{
                        "Left":0,
                        "Top":0,
                        "Right":0,
                        "Bottom":0
                     },
                     "Children":[
                        
                     ]
                  },
                  {
                     "X":-1920,
                     "Y":0,
                     "Width":1920,
                     "Height":1045,
                     "__type":"TilingWindow",
                     "FocusIndex":1,
                     "Handle":67122,
                     "FloatingPlacement":{
                        "Left":-1920,
                        "Top":0,
                        "Right":0,
                        "Bottom":1045,
                        "X":-1920,
                        "Y":0,
                        "Width":1920,
                        "Height":1045
                     },
                     "BorderDelta":{
                        "Left":0,
                        "Top":0,
                        "Right":0,
                        "Bottom":0
                     },
                     "SizePercentage":1,
                     "Children":[
                        
                     ]
                  }
               ]
            },
            {
               "X":-1920,
               "Y":0,
               "Width":1920,
               "Height":1045,
               "__type":"Workspace",
               "FocusIndex":0,
               "Name":"10",
               "Children":[
                  {
                     "X":-1920,
                     "Y":0,
                     "Width":1920,
                     "Height":1045,
                     "__type":"TilingWindow",
                     "FocusIndex":0,
                     "Handle":67262,
                     "FloatingPlacement":{
                        "Left":-1919,
                        "Top":0,
                        "Right":-1,
                        "Bottom":1044,
                        "X":-1919,
                        "Y":0,
                        "Width":1918,
                        "Height":1044
                     },
                     "BorderDelta":{
                        "Left":-1,
                        "Top":0,
                        "Right":-1,
                        "Bottom":-1
                     },
                     "SizePercentage":1,
                     "Children":[
                        
                     ]
                  }
               ]
            },
            {
               "X":-1920,
               "Y":0,
               "Width":1920,
               "Height":1045,
               "__type":"Workspace",
               "FocusIndex":2,
               "Name":"4",
               "Children":[
                  {
                     "X":-1920,
                     "Y":0,
                     "Width":960,
                     "Height":1045,
                     "__type":"TilingWindow",
                     "FocusIndex":1,
                     "Handle":198516,
                     "FloatingPlacement":{
                        "Left":-1927,
                        "Top":-4,
                        "Right":7,
                        "Bottom":1048,
                        "X":-1927,
                        "Y":-4,
                        "Width":1934,
                        "Height":1052
                     },
                     "BorderDelta":{
                        "Left":7,
                        "Top":0,
                        "Right":7,
                        "Bottom":7
                     },
                     "SizePercentage":0.5,
                     "Children":[
                        
                     ]
                  },
                  {
                     "X":-960,
                     "Y":0,
                     "Width":960,
                     "Height":1045,
                     "__type":"TilingWindow",
                     "FocusIndex":0,
                     "Handle":921028,
                     "FloatingPlacement":{
                        "Left":-1468,
                        "Top":188,
                        "Right":-451,
                        "Bottom":857,
                        "X":-1468,
                        "Y":188,
                        "Width":1017,
                        "Height":669
                     },
                     "BorderDelta":{
                        "Left":7,
                        "Top":0,
                        "Right":7,
                        "Bottom":7
                     },
                     "SizePercentage":0.5,
                     "Children":[
                        
                     ]
                  }
               ]
            }
         ]
      },
      {
         "X":2560,
         "Y":0,
         "Width":1920,
         "Height":1080,
         "__type":"Monitor",
         "FocusIndex":0,
         "DeviceName":"\\\\.\\DISPLAY2",
         "Children":[
            {
               "X":2560,
               "Y":0,
               "Width":1920,
               "Height":1045,
               "__type":"Workspace",
               "FocusIndex":0,
               "Name":"7",
               "Children":[
                  {
                     "X":2560,
                     "Y":0,
                     "Width":1920,
                     "Height":1045,
                     "__type":"TilingWindow",
                     "FocusIndex":0,
                     "Handle":396784,
                     "FloatingPlacement":{
                        "Left":3012,
                        "Top":188,
                        "Right":4029,
                        "Bottom":857,
                        "X":3012,
                        "Y":188,
                        "Width":1017,
                        "Height":669
                     },
                     "BorderDelta":{
                        "Left":7,
                        "Top":0,
                        "Right":7,
                        "Bottom":7
                     },
                     "SizePercentage":1,
                     "Children":[
                        
                     ]
                  }
               ]
            }
         ]
      },
      {
         "X":0,
         "Y":0,
         "Width":2560,
         "Height":1080,
         "__type":"Monitor",
         "FocusIndex":1,
         "DeviceName":"\\\\.\\DISPLAY3",
         "Children":[
            {
               "X":0,
               "Y":0,
               "Width":2560,
               "Height":1045,
               "__type":"Workspace",
               "FocusIndex":1,
               "Name":"1",
               "Children":[
                  {
                     "X":0,
                     "Y":0,
                     "Width":0,
                     "Height":0,
                     "__type":"MinimizedWindow",
                     "FocusIndex":2,
                     "Handle":395576,
                     "FloatingPlacement":{
                        "Left":780,
                        "Top":259,
                        "Right":1781,
                        "Bottom":786,
                        "X":780,
                        "Y":259,
                        "Width":1001,
                        "Height":527
                     },
                     "BorderDelta":{
                        "Left":7,
                        "Top":0,
                        "Right":7,
                        "Bottom":7
                     },
                     "PreviousState":"Tiling",
                     "Children":[
                        
                     ]
                  },
                  {
                     "X":0,
                     "Y":0,
                     "Width":2560,
                     "Height":1045,
                     "__type":"TilingWindow",
                     "FocusIndex":1,
                     "Handle":264046,
                     "FloatingPlacement":{
                        "Left":793,
                        "Top":-4,
                        "Right":1767,
                        "Bottom":1048,
                        "X":793,
                        "Y":-4,
                        "Width":974,
                        "Height":1052
                     },
                     "BorderDelta":{
                        "Left":7,
                        "Top":0,
                        "Right":7,
                        "Bottom":7
                     },
                     "SizePercentage":1,
                     "Children":[
                        
                     ]
                  },
                  {
                     "X":0,
                     "Y":0,
                     "Width":0,
                     "Height":0,
                     "__type":"MinimizedWindow",
                     "FocusIndex":0,
                     "Handle":525332,
                     "FloatingPlacement":{
                        "Left":780,
                        "Top":259,
                        "Right":1781,
                        "Bottom":786,
                        "X":780,
                        "Y":259,
                        "Width":1001,
                        "Height":527
                     },
                     "BorderDelta":{
                        "Left":7,
                        "Top":0,
                        "Right":7,
                        "Bottom":7
                     },
                     "PreviousState":"Tiling",
                     "Children":[
                        
                     ]
                  }
               ]
            },
            {
               "X":0,
               "Y":0,
               "Width":2560,
               "Height":1045,
               "__type":"Workspace",
               "FocusIndex":0,
               "Name":"2",
               "Children":[
                  
               ]
            }
         ]
      }
   ]
}
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

1 participant