Ticket #4721: app_server_flags_4721_nowindowmod.patch

File app_server_flags_4721_nowindowmod.patch, 3.5 KB (added by rogueeve, 15 years ago)

same patch as above, but does not add B_VALID_WINDOW_FLAGS

  • src/servers/app/Window.cpp

     
    781781    int32 modifiers = _ExtractModifiers(message);
    782782    bool inBorderRegion = fBorderRegion.Contains(where);
    783783    bool windowModifier = (fFlags & B_NO_SERVER_SIDE_WINDOW_MODIFIERS) == 0
    784         && (~modifiers & (B_COMMAND_KEY | B_CONTROL_KEY)) == 0;
     784                            && (modifiers & (B_COMMAND_KEY | B_CONTROL_KEY
     785                                            | B_OPTION_KEY | B_SHIFT_KEY))
     786                                        == B_COMMAND_KEY | B_CONTROL_KEY;
    785787
    786     // default action is to drag the Window
    787     if (windowModifier || inBorderRegion) {
    788         // clicking Window visible area
    789 
    790         click_type action = DEC_NONE;
     788    // get special action if any (drag, resize etc)
     789    click_type action = DEC_NONE;
     790   
     791    if (inBorderRegion || windowModifier) {
     792        // clicking window title bar/borders, or windowModifier keys are down
    791793        int32 buttons = _ExtractButtons(message);
    792794
    793795        if (inBorderRegion && fDecorator != NULL)
     
    803805        // non-floating window doesn't have focus
    804806        if (!IsFocus() && !IsFloating() && action != DEC_MOVETOBACK
    805807            && action != DEC_RESIZE && action != DEC_SLIDETAB)
    806             action = DEC_DRAG;
     808            action = (fFlags & B_NOT_MOVABLE) ? DEC_NONE : DEC_DRAG;
     809    }
     810   
     811    // let clicks caught by windowModifier through to window if no special
     812    // action would take place anyway, e.g. if window is not movable.
     813    if (inBorderRegion || (windowModifier && action != DEC_NONE)) {
    807814
    808815        // set decorator internals
    809816        switch (action) {
     
    15301537}
    15311538
    15321539
    1533 /*! Returns wether or not a window is in the workspace list with the
     1540/*! Returns whether or not a window is in the workspace list with the
    15341541    specified \a index.
    15351542*/
    15361543bool
     
    18471854/*static*/ uint32
    18481855Window::ValidWindowFlags()
    18491856{
    1850     return B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE
    1851         | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE
    1852         | B_NOT_H_RESIZABLE | B_NOT_V_RESIZABLE
    1853         | B_AVOID_FRONT | B_AVOID_FOCUS
    1854         | B_WILL_ACCEPT_FIRST_CLICK | B_OUTLINE_RESIZE
    1855         | B_NO_WORKSPACE_ACTIVATION
    1856         | B_NOT_ANCHORED_ON_ACTIVATE
    1857         | B_ASYNCHRONOUS_CONTROLS
    1858         | B_QUIT_ON_WINDOW_CLOSE
    1859         | B_SAME_POSITION_IN_ALL_WORKSPACES
    1860         | kWindowScreenFlag;
     1857    return B_NOT_MOVABLE
     1858            | B_NOT_CLOSABLE
     1859            | B_NOT_ZOOMABLE
     1860            | B_NOT_MINIMIZABLE
     1861            | B_NOT_RESIZABLE
     1862            | B_NOT_H_RESIZABLE
     1863            | B_NOT_V_RESIZABLE
     1864            | B_AVOID_FRONT
     1865            | B_AVOID_FOCUS
     1866            | B_WILL_ACCEPT_FIRST_CLICK
     1867            | B_OUTLINE_RESIZE
     1868            | B_NO_WORKSPACE_ACTIVATION
     1869            | B_NOT_ANCHORED_ON_ACTIVATE
     1870            | B_ASYNCHRONOUS_CONTROLS
     1871            | B_QUIT_ON_WINDOW_CLOSE
     1872            | B_SAME_POSITION_IN_ALL_WORKSPACES
     1873            | B_AUTO_UPDATE_SIZE_LIMITS
     1874            | B_CLOSE_ON_ESCAPE
     1875            | B_NO_SERVER_SIDE_WINDOW_MODIFIERS
     1876            | kWindowScreenFlag;
    18611877}
    18621878
    18631879
  • headers/os/interface/Window.h

     
    3232    B_FLOATING_WINDOW                   = 21
    3333};
    3434
     35// must update app_server's IsValidLook() when changing
    3536enum window_look {
    3637    B_BORDERED_WINDOW_LOOK              = 20,
    3738    B_NO_BORDER_WINDOW_LOOK             = 19,
     
    4142    B_FLOATING_WINDOW_LOOK              = 7
    4243};
    4344
     45// must update app_server's IsValidFeel() when changing
    4446enum window_feel {
    4547    B_NORMAL_WINDOW_FEEL                = 0,
    4648    B_MODAL_SUBSET_WINDOW_FEEL          = 2,
     
    5759};
    5860
    5961// window flags
     62// WARNING: must update app_server's ValidWindowFlags() if adding/removing
    6063enum {
    6164    B_NOT_MOVABLE                       = 0x00000001,
    6265    B_NOT_CLOSABLE                      = 0x00000020,