update screen info before mapping window
This commit is contained in:
parent
880c8fcbe4
commit
4feac25664
44
dunst.c
44
dunst.c
@ -114,6 +114,7 @@ char *string_replace(const char *needle, const char *replacement,
|
|||||||
char *strtrim(char *str);
|
char *strtrim(char *str);
|
||||||
void run(void);
|
void run(void);
|
||||||
void setup(void);
|
void setup(void);
|
||||||
|
void update_screen_info();
|
||||||
void usage(int exit_status);
|
void usage(int exit_status);
|
||||||
void hide_window();
|
void hide_window();
|
||||||
l_node *most_important(list * l);
|
l_node *most_important(list * l);
|
||||||
@ -859,28 +860,12 @@ void hide_win()
|
|||||||
visible = False;
|
visible = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup(void)
|
void update_screen_info()
|
||||||
{
|
{
|
||||||
Window root;
|
|
||||||
XSetWindowAttributes wa;
|
|
||||||
KeyCode code;
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
int n;
|
int n;
|
||||||
XineramaScreenInfo *info;
|
XineramaScreenInfo *info;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
notification_queue = l_init();
|
|
||||||
notification_history = l_init();
|
|
||||||
displayed_notifications = l_init();
|
|
||||||
if (scr.scr < 0) {
|
|
||||||
scr.scr = DefaultScreen(dc->dpy);
|
|
||||||
}
|
|
||||||
root = RootWindow(dc->dpy, DefaultScreen(dc->dpy));
|
|
||||||
|
|
||||||
utf8 = XInternAtom(dc->dpy, "UTF8_STRING", False);
|
|
||||||
|
|
||||||
/* menu geometry */
|
|
||||||
font_h = dc->font.height + FONT_HEIGHT_BORDER;
|
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
if ((info = XineramaQueryScreens(dc->dpy, &n))) {
|
if ((info = XineramaQueryScreens(dc->dpy, &n))) {
|
||||||
if (scr.scr >= n) {
|
if (scr.scr >= n) {
|
||||||
@ -900,6 +885,29 @@ void setup(void)
|
|||||||
scr.dim.w = DisplayWidth(dc->dpy, scr.scr);
|
scr.dim.w = DisplayWidth(dc->dpy, scr.scr);
|
||||||
scr.dim.h = DisplayHeight(dc->dpy, scr.scr);
|
scr.dim.h = DisplayHeight(dc->dpy, scr.scr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setup(void)
|
||||||
|
{
|
||||||
|
Window root;
|
||||||
|
XSetWindowAttributes wa;
|
||||||
|
KeyCode code;
|
||||||
|
|
||||||
|
notification_queue = l_init();
|
||||||
|
notification_history = l_init();
|
||||||
|
displayed_notifications = l_init();
|
||||||
|
if (scr.scr < 0) {
|
||||||
|
scr.scr = DefaultScreen(dc->dpy);
|
||||||
|
}
|
||||||
|
root = RootWindow(dc->dpy, DefaultScreen(dc->dpy));
|
||||||
|
|
||||||
|
utf8 = XInternAtom(dc->dpy, "UTF8_STRING", False);
|
||||||
|
|
||||||
|
/* menu geometry */
|
||||||
|
font_h = dc->font.height + FONT_HEIGHT_BORDER;
|
||||||
|
|
||||||
|
update_screen_info();
|
||||||
|
|
||||||
/* menu window */
|
/* menu window */
|
||||||
wa.override_redirect = True;
|
wa.override_redirect = True;
|
||||||
wa.background_pixmap = ParentRelative;
|
wa.background_pixmap = ParentRelative;
|
||||||
@ -935,6 +943,8 @@ void map_win(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update_screen_info();
|
||||||
|
|
||||||
XMapRaised(dc->dpy, win);
|
XMapRaised(dc->dpy, win);
|
||||||
XGrabButton(dc->dpy, AnyButton, AnyModifier, win, False,
|
XGrabButton(dc->dpy, AnyButton, AnyModifier, win, False,
|
||||||
BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
|
BUTTONMASK, GrabModeAsync, GrabModeSync, None, None);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user