示例#1
0
文件: desktop.c 项目: AlexSteel/wine
static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam )
{
    struct x11drv_win_data *data;
    struct desktop_resize_data *resize_data = (struct desktop_resize_data *)lparam;
    int mask = 0;

    if (!(data = get_win_data( hwnd ))) return TRUE;

    /* update the full screen state */
    update_net_wm_states( data );

    if (resize_data->old_virtual_rect.left != resize_data->new_virtual_rect.left) mask |= CWX;
    if (resize_data->old_virtual_rect.top != resize_data->new_virtual_rect.top) mask |= CWY;
    if (mask && data->whole_window)
    {
        POINT pos = virtual_screen_to_root( data->whole_rect.left, data->whole_rect.top );
        XWindowChanges changes;
        changes.x = pos.x;
        changes.y = pos.y;
        XReconfigureWMWindow( data->display, data->whole_window, data->vis.screen, mask, &changes );
    }
    release_win_data( data );
    if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd, TRUE );
    return TRUE;
}
示例#2
0
static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam )
{
    struct x11drv_win_data *data;
    Display *display = thread_display();
    struct desktop_resize_data *resize_data = (struct desktop_resize_data *)lparam;
    int mask = 0;

    if (!(data = X11DRV_get_win_data( hwnd ))) return TRUE;

    /* update the full screen state */
    update_net_wm_states( display, data );

    if (resize_data->old_virtual_rect.left != virtual_screen_rect.left) mask |= CWX;
    if (resize_data->old_virtual_rect.top != virtual_screen_rect.top) mask |= CWY;
    if (mask && data->whole_window)
    {
        XWindowChanges changes;

        wine_tsx11_lock();
        changes.x = data->whole_rect.left - virtual_screen_rect.left;
        changes.y = data->whole_rect.top - virtual_screen_rect.top;
        XReconfigureWMWindow( display, data->whole_window,
                              DefaultScreen(display), mask, &changes );
        wine_tsx11_unlock();
    }
    if (hwnd == GetForegroundWindow()) clip_fullscreen_window( hwnd, TRUE );
    return TRUE;
}
示例#3
0
文件: Main.c 项目: juddy/edcde
/*+++++++++++++++++++++++++++++++++++++++++++*/
void 
raiseWindow(
        Window dialogWin )
{
  static int changeMask = CWStackMode;
  static XWindowChanges windowChanges = {0,0,0,0,0,0,Above};

    XReconfigureWMWindow(style.display, dialogWin,
      style.screenNum, changeMask, &windowChanges);
}
示例#4
0
文件: X_gram.c 项目: andersk/zephyr
void
x_gram_create(Display *dpy,
              x_gram *gram,
              int xalign,
              int yalign,
              int xpos,
              int ypos,
              int xsize,
              int ysize,
              int beepcount)
{
    Window w;
    XSizeHints sizehints;
    XWMHints wmhints;
    XSetWindowAttributes attributes;
    unsigned long all_desktops = 0xFFFFFFFF;

    /*
     * Adjust xpos, ypos based on the alignments xalign, yalign and the sizes:
     */
    if (xalign < 0)
      xpos = WidthOfScreen(DefaultScreenOfDisplay(dpy))
          - xpos - xsize - 2 * border_width;
    else if (xalign == 0)
      xpos = ((WidthOfScreen(DefaultScreenOfDisplay(dpy))
               - xsize - 2 * border_width) >> 1) + xpos;

    if (yalign<0)
      ypos = HeightOfScreen(DefaultScreenOfDisplay(dpy))
          - ypos - ysize - 2 * border_width;
    else if (yalign == 0)
      ypos = ((HeightOfScreen(DefaultScreenOfDisplay(dpy))
               - ysize - 2 * border_width) >> 1) + ypos;

    /*
     * Create the window:
     */
    attributes = xattributes;
    attributes.background_pixel = gram->bgcolor;
    
    gram->w = w = XCreateWindow (dpy, DefaultRootWindow (dpy), xpos, ypos,
                                 xsize, ysize, border_width, 0,
                                 CopyFromParent, CopyFromParent,
                                 xattributes_mask, &attributes);
    
    sizehints.x = xpos;
    sizehints.y = ypos;
    sizehints.width = xsize;
    sizehints.height = ysize;
    sizehints.win_gravity = x_calc_gravity(xalign, yalign);
    sizehints.flags = USPosition | USSize | PWinGravity;

    wmhints.input = False;
    wmhints.initial_state = NormalState;
    if (set_transient) {
       wmhints.window_group = group_leader;
       wmhints.flags = InputHint | StateHint | WindowGroupHint;

       x_set_icccm_hints(dpy, w, title_name, icon_name, &sizehints, &wmhints,
                         group_leader);
    } else {
       wmhints.flags = InputHint | StateHint;

       x_set_icccm_hints(dpy, w, title_name, icon_name, &sizehints, &wmhints, 0);
    }
       
    if (net_wm_window_type != None && net_wm_window_type_utility != None)
        XChangeProperty(dpy, w, net_wm_window_type, XA_ATOM, 32, PropModeReplace,
                        (unsigned char *) &net_wm_window_type_utility, 1);
    if (set_all_desktops && net_wm_desktop != None)
        XChangeProperty(dpy, w, net_wm_desktop, XA_CARDINAL, 32, PropModeReplace,
                        (unsigned char *) &all_desktops, 1);

    XSaveContext(dpy, w, desc_context, (XPointer)gram);

    gram->can_die.tv_sec = 0;

    XMapWindow(dpy, w);

    if (beepcount)
        XBell(dpy, 0);

    xerror_happened = 0;
    if (reverse_stack && bottom_gram) {
       XWindowChanges winchanges;
       
       winchanges.sibling = bottom_gram->w;
       winchanges.stack_mode = Below;
       /* Metacity may use border_width even if it's not specified in
        * the value mask, so we must initialize it.  See:
        * http://bugzilla.gnome.org/show_bug.cgi?id=305257 */
       winchanges.border_width = border_width;

       begin_xerror_trap (dpy);
       XReconfigureWMWindow (dpy, w, DefaultScreen (dpy),
                             CWSibling | CWStackMode, &winchanges);
       end_xerror_trap (dpy);
       if (xerror_happened) {
           /* The event didn't go.  Print an error message, and continue.  */
           ERROR ("Error configuring window to the bottom of the stack.\n");
       }
    }
    /* we always need to keep a linked list of windows */
    add_to_bottom(gram);
    if (xerror_happened)
       pull_to_top(gram);

    if (reset_saver)
        XResetScreenSaver(dpy);

    XFlush(dpy);
    /* Because the flushing/syncing/etc with the error trapping can cause
       events to be read into the Xlib queue, we need to go through the queue
       here before exiting so that any pending events get processed.
       */
    x_get_input(dpy);
}