Skip to content

Commit

Permalink
Add icons to struct, add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHussky committed Jul 18, 2021
1 parent 3d68cab commit d9b8a45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions src/xcb_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ ewmh_change_desktop (xcb_connection_t *c, xcb_window_t root, uint destkop_id)
// of this spec, in which case the timestamp field should be ignored.
send_xcb_message (c, root, "_NET_CURRENT_DESKTOP", { destkop_id });
}
/**
* Get information about
* all windows, including
* ids, related desktops,
* geometries and icons
*/

std::vector<window_info>
get_windows (xcb_connection_t *c, xcb_window_t root)
Expand All @@ -291,11 +297,10 @@ get_windows (xcb_connection_t *c, xcb_window_t root)

auto desktop_id = get_property_value (c, id, "_NET_WM_DESKTOP");

// TODO(sthussky): Get suitable window icon

windows.emplace_back (desktop_id[0], uint (geometry->x),
uint (geometry->y), geometry->width,
geometry->height);
geometry->height, get_property_value(c, id, "_NET_WM_ICON"));
}
return windows;
}
6 changes: 3 additions & 3 deletions src/xcb_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ struct monitor_info
struct window_info
{
uint desktop; ///< Id of the desktop the window belongs to
uint x;
uint y;
uint x; ///< Left upper angle coordinate
uint y; ///< Left upper angle coordinate
uint width;
uint height;
// xcb_pixmap_t *icon ; TODO(sthussky): implement this
std::vector<uint32_t> icons; /// All posssible window inocns from EMWHs
};

class xcb_error : public std::runtime_error
Expand Down

0 comments on commit d9b8a45

Please sign in to comment.