Ticket #16: thepatch.2.diff

File thepatch.2.diff, 1.2 kB (added by shadow@serverart.org, 3 years ago)

Updated, Hack to make NETWM fullscreen function. (Diff against svn HEAD r52)

  • feh/src/winwidget.c

    old new  
    158158                        int h) 
    159159{ 
    160160  XSetWindowAttributes attr; 
     161  XEvent ev; 
    161162  XClassHint *xch; 
    162163  MWMHints mwmhints; 
    163164  Atom prop = None; 
     
    256257    XChangeProperty(disp, ret->win, prop, prop, 32, PropModeReplace, 
    257258                    (unsigned char *) &mwmhints, PROP_MWM_HINTS_ELEMENTS); 
    258259  } 
     260  if (ret->full_screen) { 
     261    Atom prop_fs = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN",  False); 
     262        Atom prop_state = XInternAtom(disp, "_NET_WM_STATE", False); 
     263 
     264        memset(&ev, 0, sizeof(ev)); 
     265        ev.xclient.type = ClientMessage; 
     266        ev.xclient.message_type = prop_state; 
     267        ev.xclient.display = disp; 
     268        ev.xclient.window = ret->win; 
     269        ev.xclient.format = 32; 
     270        ev.xclient.data.l[0] = (ret->full_screen ? 1 : 0); 
     271        ev.xclient.data.l[1] = prop_fs; 
     272 
     273    XChangeProperty(disp, ret->win, prop_state, XA_ATOM, 32, 
     274                                        PropModeReplace, &prop_fs, 1); 
     275  } 
    259276 
    260277  XSetWMProtocols(disp, ret->win, &wmDeleteWindow, 1); 
    261278  winwidget_update_title(ret);