Skip to content

Commit

Permalink
Standalone compositor 1., #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jaelpark committed Jul 16, 2020
1 parent 7d0cd7d commit 809d1f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion shaders/frame.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void main(point float2 posh[1], inout TriangleStream<GS_OUTPUT> stream){

#include "chamfer.hlsl"

#define STOCK_FRAME_STYLE 1 //select between two stock styles (1: chamfered edges, other: basic rectangle borders)
#define STOCK_FRAME_STYLE 0 //select between two stock styles (1: chamfered edges, other: basic rectangle borders)

const float borderScaling = 1.0f;
const float4 borderColor = float4(0.0f,0.0f,0.0f,1.0f);
Expand Down Expand Up @@ -136,6 +136,7 @@ float4 main(float4 posh : SV_Position, float2 texc : TEXCOORD) : SV_Target{
return borderColor;
}
#endif //STOCK_FRAME_STYLE

float2 a_content = screen*(0.5f*xy0+0.5f); //top-left corner in pixels, content area
float2 b_content = screen*(0.5f*xy1+0.5f); //bottom-right corner in pixels, content areaa
if(any(posh.xy < a_content) || any(posh.xy > b_content)){ //title region
Expand Down
8 changes: 4 additions & 4 deletions src/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,6 @@ Default::Default(bool _standaloneComp) : X11Backend(), pdragClient(0), standalon
pollTimer.tv_sec = 0;
pollTimer.tv_nsec = 0;
//polling = false;

printf("------standalone comp: %u\n",standaloneComp);
}

Default::~Default(){
Expand Down Expand Up @@ -617,11 +615,12 @@ void Default::Start(){
xcb_grab_key(pcon,1,pscr->root,XCB_MOD_MASK_1|XCB_MOD_MASK_SHIFT,exitKeycode,
XCB_GRAB_MODE_ASYNC,XCB_GRAB_MODE_ASYNC);

DefineBindings();
if(!standaloneComp)
DefineBindings();

xcb_flush(pcon);

uint values[2] = {XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT
uint values[2] = {(!standaloneComp?XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT:0)
|XCB_EVENT_MASK_STRUCTURE_NOTIFY
|XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY
|XCB_EVENT_MASK_EXPOSURE
Expand Down Expand Up @@ -1510,6 +1509,7 @@ sint Default::HandleEvent(bool forcePoll){
case XCB_FOCUS_IN:{
xcb_focus_in_event_t *pev = (xcb_focus_in_event_t*)pevent;
printf("XCB_FOCUS_IN: *** focus %x\n",pev->event);
//TODO: standaloneComp: set focus. All clients share the same container
}
break;
case XCB_ENTER_NOTIFY:{
Expand Down

0 comments on commit 809d1f8

Please sign in to comment.