WebFreak001 / DWin-Bar

A taskbar for linux with DWin in mind
20 stars 4 forks source link

Start up crash: Problems with battery widget #16

Closed dhd5076 closed 7 years ago

dhd5076 commented 7 years ago

Program crashes as seen below. This is only preventable when the .add(new BatteryWidget... line is removed indicating that there is something wrong with loading of the battery widget.

NOTE: I am on a desktop and I didn't have this issue on my laptop so it might be since a desktop doesn't have a battery that it might have trouble reading that fd.

----------------
../../../.dub/packages/ddbus-2.1.0/ddbus/source/ddbus/thin.d:26 ddbus.c_lib.DBusMessage* ddbus.thin.wrapErrors!(ddbus.c_lib.DBusMessage*).wrapErrors(ddbus.c_lib.DBusMessage* delegate(ddbus.c_lib.DBusError*)) [0x5edaa2]
../../../.dub/packages/ddbus-2.1.0/ddbus/source/ddbus/thin.d:525 ddbus.thin.Message ddbus.thin.Connection.sendWithReplyBlocking(ddbus.thin.Message, int) [0x5e80b0]
../../../.dub/packages/ddbus-2.1.0/ddbus/source/ddbus/simple.d:28 ddbus.thin.Message ddbus.simple.PathIface.opDispatch!("Get", immutable(char)[], immutable(char)[]).opDispatch(immutable(char)[], immutable(char)[]) [0x5a0964]
source/dwinbar/widgets/battery.d:88 void dwinbar.widgets.battery.BatteryWidget.update(dwinbar.bar.Bar) [0x5cb0b4]
source/dwinbar/bar.d:312 void dwinbar.bar.Panel.update(dwinbar.bar.Bar) [0x5bfbde]
source/dwinbar/bar.d:711 void dwinbar.bar.Bar.start() [0x5c3b76]
source/app.d:22 _Dmain [0x571583]
Program exited with code 1

Commentating off the battery widget line as previously stated prevents the crash/errors

    //dfmt off
    bar.addPanel(Screen.First, Dock.Bottom, panelConfig)
        .add(new ClockWidget())
        // find using `dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.EnumerateDevices`
        //.add(new BatteryWidget(bar.fontFamily, "/org/freedesktop/UPower/devices/battery_BAT1"))
        .add(new NotificationsWidget(&bar))
        .add(new VolumeWidget())
        .add(new WorkspaceWidget(bar.x, "HDMI-1"))
dhd5076 commented 7 years ago

Full Log:

dhd5076@mainuser-Lemur:~/Documents/Git/DWin-Bar$ sudo dub
Performing "debug" build using dmd for x86_64.
dunit 1.0.14: target for configuration "library" is up to date.
ddbus 2.1.0: target for configuration "library" is up to date.
derelict-util 3.0.0-beta.2: target for configuration "library" is up to date.
derelict-ft 2.0.0-beta.2: target for configuration "library" is up to date.
eventsystem 1.2.0: target for configuration "library" is up to date.
imageformats 6.1.1: target for configuration "library" is up to date.
x11 1.0.19: target for configuration "library" is up to date.
dwin-bar ~master: target for configuration "application" is up to date.
To force a rebuild of up-to-date targets, run again with --force.
Running ./dwin-bar 
Atom 309 = WM_DELETE_WINDOW
Atom 311 = WM_PROTOCOLS
Atom 429 = _XROOTPMAP_ID
Atom 595 = _XROOTMAP_ID
Atom 315 = _NET_CURRENT_DESKTOP
Atom 421 = _NET_NUMBER_OF_DESKTOPS
Atom 427 = _NET_DESKTOP_NAMES
Atom 424 = _NET_DESKTOP_GEOMETRY
Atom 425 = _NET_DESKTOP_VIEWPORT
Atom 443 = _NET_WORKAREA
Atom 314 = _NET_ACTIVE_WINDOW
Atom 338 = _NET_WM_WINDOW_TYPE
Atom 334 = _NET_WM_STATE_SKIP_PAGER
Atom 333 = _NET_WM_STATE_SKIP_TASKBAR
Atom 335 = _NET_WM_STATE_STICKY
Atom 445 = _NET_WM_STATE_DEMANDS_ATTENTION
Atom 384 = _NET_WM_WINDOW_TYPE_DOCK
Atom 385 = _NET_WM_WINDOW_TYPE_DESKTOP
Atom 382 = _NET_WM_WINDOW_TYPE_TOOLBAR
Atom 343 = _NET_WM_WINDOW_TYPE_MENU
Atom 383 = _NET_WM_WINDOW_TYPE_SPLASH
Atom 340 = _NET_WM_WINDOW_TYPE_DIALOG
Atom 344 = _NET_WM_WINDOW_TYPE_NORMAL
Atom 386 = _NET_WM_WINDOW_TYPE_NOTIFICATION
Atom 319 = _NET_WM_DESKTOP
Atom 370 = WM_STATE
Atom 308 = WM_CLIENT_LEADER
Atom 325 = _NET_WM_STATE
Atom 331 = _NET_WM_STATE_MAXIMIZED_VERT
Atom 332 = _NET_WM_STATE_MAXIMIZED_HORZ
Atom 444 = _NET_WM_STATE_SHADED
Atom 329 = _NET_WM_STATE_HIDDEN
Atom 327 = _NET_WM_STATE_BELOW
Atom 326 = _NET_WM_STATE_ABOVE
Atom 330 = _NET_WM_STATE_MODAL
Atom 352 = _NET_WM_STATE_FOCUSED
Atom 423 = _NET_CLIENT_LIST
Atom 422 = _NET_CLIENT_LIST_STACKING
Atom 483 = _NET_WM_VISIBLE_NAME
Atom 322 = _NET_WM_NAME
Atom 461 = _NET_WM_STRUT
Atom 320 = _NET_WM_ICON
Atom 463 = _NET_WM_ICON_GEOMETRY
Atom 321 = _NET_WM_ICON_NAME
Atom 596 = _NET_WM_HANDLED_ICONS
Atom 348 = _NET_WM_USER_TIME
Atom 468 = _NET_CLOSE_WINDOW
Atom 307 = UTF8_STRING
Atom 364 = _NET_SUPPORTING_WM_CHECK
Atom 462 = _NET_WM_STRUT_PARTIAL
Atom 39 = WM_NAME
Atom 37 = WM_ICON_NAME
Atom 365 = _NET_WM_OPAQUE_REGION
Atom 474 = _MOTIF_WM_HINTS
Atom 35 = WM_HINTS
Atom 399 = _XSETTINGS_SETTINGS
Atom 415 = _NET_SYSTEM_TRAY_OPCODE
Atom 400 = MANAGER
Atom 557 = _NET_SYSTEM_TRAY_MESSAGE_DATA
Atom 416 = _NET_SYSTEM_TRAY_ORIENTATION
Atom 420 = _NET_SYSTEM_TRAY_ICON_SIZE
Atom 419 = _NET_SYSTEM_TRAY_PADDING
Atom 417 = _NET_SYSTEM_TRAY_VISUAL
Atom 544 = _XEMBED
Atom 430 = _XEMBED_INFO
Atom 323 = _NET_WM_PID
Atom 324 = _NET_WM_PING
Atom 597 = I3_SOCKET_PATH
Atom 371 = XdndAware
Atom 376 = XdndEnter
Atom 378 = XdndPosition
Atom 379 = XdndStatus
Atom 381 = XdndDrop
Atom 377 = XdndLeave
Atom 508 = XdndSelection
Atom 532 = XdndTypeList
Atom 534 = XdndActionCopy
Atom 380 = XdndFinished
Atom 475 = TARGETS
Loading font from /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Loading font from /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Loading font from /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
Loading font from /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf
process 17327: arguments to dbus_connection_unref() were incorrect, assertion "connection != NULL" failed in file ../../dbus/dbus-connection.c line 2821.
This is normally a bug in some application using the D-Bus library.
process 17327: arguments to dbus_connection_unref() were incorrect, assertion "connection != NULL" failed in file ../../dbus/dbus-connection.c line 2821.
This is normally a bug in some application using the D-Bus library.
[MessagePattern("/org/freedesktop/Notifications", "org.freedesktop.Notifications", "CloseNotification", false), MessagePattern("/org/freedesktop/Notifications", "org.freedesktop.Notifications", "toString", false), MessagePattern("/org/freedesktop/Notifications", "org.freedesktop.Notifications", "toHash", false), MessagePattern("/org/freedesktop/Notifications", "org.freedesktop.Notifications", "GetServerInformation", false), MessagePattern("/org/freedesktop/Notifications", "org.freedesktop.Notifications", "Notify", false), MessagePattern("/org/freedesktop/Notifications", "org.freedesktop.Notifications", "Restack", false), MessagePattern("/org/freedesktop/Notifications", "org.freedesktop.Notifications", "GetCapabilities", false)]
Unknown Property changed: _NET_WORKAREA
ddbus.thin.DBusException@../../../.dub/packages/ddbus-2.1.0/ddbus/source/ddbus/thin.d(17): No such interface 'org.freedesktop.DBus.Properties' on object at path /org/freedesktop/UPower/devices/battery_BAT1
----------------
../../../.dub/packages/ddbus-2.1.0/ddbus/source/ddbus/thin.d:26 ddbus.c_lib.DBusMessage* ddbus.thin.wrapErrors!(ddbus.c_lib.DBusMessage*).wrapErrors(ddbus.c_lib.DBusMessage* delegate(ddbus.c_lib.DBusError*)) [0x5edaa2]
../../../.dub/packages/ddbus-2.1.0/ddbus/source/ddbus/thin.d:525 ddbus.thin.Message ddbus.thin.Connection.sendWithReplyBlocking(ddbus.thin.Message, int) [0x5e80b0]
../../../.dub/packages/ddbus-2.1.0/ddbus/source/ddbus/simple.d:28 ddbus.thin.Message ddbus.simple.PathIface.opDispatch!("Get", immutable(char)[], immutable(char)[]).opDispatch(immutable(char)[], immutable(char)[]) [0x5a0964]
source/dwinbar/widgets/battery.d:88 void dwinbar.widgets.battery.BatteryWidget.update(dwinbar.bar.Bar) [0x5cb0b4]
source/dwinbar/bar.d:312 void dwinbar.bar.Panel.update(dwinbar.bar.Bar) [0x5bfbde]
source/dwinbar/bar.d:711 void dwinbar.bar.Bar.start() [0x5c3b76]
source/app.d:22 _Dmain [0x571583]
Program exited with code 1
WebFreak001 commented 7 years ago

well yes without a battery you shouldn't add a battery widget. Also you should install Roboto fonts for it looking better