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

Handle resize events [Feature request #196] #197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cpixl
Copy link

@cpixl cpixl commented Dec 30, 2016

Implements resize events handling as requested in #196.

Copy link
Owner

@LemonBoy LemonBoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not to sure about this as we do some trickery during the setup phase wrt the geometry and the monitor chains.

NET_WM_STATE,
NET_WM_STATE_STICKY,
NET_WM_STATE_ABOVE,
};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just add a NET_WM_ATOM_MAX to avoid the sizeof/sizeof repeated twice.

void
create_pixmap (monitor_t *mon)
{
if (mon->pixmap) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No brackets on 1-line ifs.

notify_ev = (xcb_configure_notify_event_t *)ev;

for (monitor_t *mon = monhead; mon; mon = mon->next) {
if (mon->window != notify_ev->window)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once the matching window is processed you can terminate the loop.

update_ewmh_atoms (void)
{
// Only desktops that support EWMH should continue
if (!atom_list[0])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a xcb_atom_t type nullable?

bw = mon->width = notify_ev->width;
bh = notify_ev->height;

create_pixmap(mon); // Xorg doesn't allow resizing pixmaps, so we create a new one
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the comment above the code so that the lines are not too long.

@cpixl
Copy link
Author

cpixl commented Feb 20, 2017

Indeed, this solution would make more sense if bar geometries were not dinamically set by default.

Particularly, it feels a bit hackish as some agreed in #163, maybe a sane approach would be to split the bar in two scripts, keeping only the manual geometry logic set by -g in lemonbar, and moving the Randr/Xinerama magic into a helper script (lemonbar-multihead?) that parses the {S*} blocks, creates a bar for each monitor and sends the relevant part of the input to each one. Then #171 would make sense again too.

Anyway, should this PR be closed? I don't feel that it makes sense too, at the current state of the project.

@ghost
Copy link

ghost commented Nov 23, 2021

Any updates on this?

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

Successfully merging this pull request may close these issues.

2 participants